Unless I'm missing a subtlety, I don't think what I'm proposing involves more than a parent process waiting directly upon several child processes.

The "process to wait for a process" arises when you use modules like Parallel::ForkManager as a substitute for threading, as someone else suggested.

That is, you cannot ask P::FM to start the processes you want directly. Instead, it forks your current program and you then start the process you want to start from that subprocess, whilst the main process continues. It's a messy solution at best.

The piped-open is asynchronous, thus you can use it to start multiple concurrent processes directly from your main process without problem.

However, most times you don't only want to start the subprocess, but also monitor (is it still running?) and control (eg. kill it if it takes to long) and at least, eventually receive information that it has ended successfully or otherwise.

For all of these things, having the pid of the actual subprocess started is necessary; and the piped-open gives you that control. It also gives you access to that subprocesses output; which is easily and economically discarded if not required.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority". I knew I was on the right track :)
In the absence of evidence, opinion is indistinguishable from prejudice.

In reply to Re^3: Multiple asynchronous execution of commands by BrowserUk
in thread Multiple asynchronous execution of commands by ibm1620

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.