Boost logo

Boost :

Subject: Re: [boost] [gsoc] Boost.Process done
From: Jeremy Maitin-Shepard (jeremy_at_[hidden])
Date: 2010-09-13 14:26:05


On 09/13/2010 11:15 AM, Stewart, Robert wrote:
> [snip]

> Hmmm. As I see it, Boost.Process would know which child
> processes it created and would only call waitpid() on those. No
> code outside the library would need to call waitpid() on those.
> All that's needed is for Boost.Process' SIGCHLD handler to be
> invoked and, if the other code needs a SIGCHLD handler, that it
> be invoked by the same mechanism, to ensure correct chaining, and
> that the other code never calls waitpid() for child processes
> that Boost.Process creates.
>
> Is that what you meant by "specific coordination?" That's not
> coordination so much as clear delineation of responsibilities and
> behaviors, but it would mean we were just talking past one
> another. If you meant something else, please clarify.

If Boost.Process has created multiple not-yet-terminated child
processes, you would need to call waitpid once for each child every time
SIGCHLD arrives. This would not scale well to e.g. 200 child processes.
  Likewise, you cannot expect code outside of Boost.Process that deals
with child processes to have to invoke waitpid in a polling fashion. (I
don't know what the actual overhead cost is, but in any case it doesn't
seem reasonable.)


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk