
On Sat, 11 Sep 2010 23:21:03 +0200, Jeremy Maitin-Shepard <jeremy@jeremyms.com> wrote:
[...]I assumed you were using waitpid with the specific pid of the child, but I just took a look at the code and see that you are using wait (which waits for any child, equivalent to waitpid with a pid of -1). This
Oh, sorry, it wasn't clear then.
indeed avoids the need for one thread per child process, but has the serious drawback that it will silently eat all notifications related to child processes not created by boost process, and therefore prevents any other code in the same program from properly dealing with child processes.
True. :(
[...]If you arranged to have all of the child processes created by boost process actually be grandchildren of the main process, and children of a special forked process created by boost.process, then you could simultaneously avoid coordination regarding SIGCHLD and waitpid, at the cost of just one additional process. However, due to the need for an additional process, I don't really like this solution either.
I have no better ideas either. It's really difficult to map the signal handler concept to Boost.Asio concepts. Maybe one shouldn't even try it and Dmitry's Boost.Asio extension is the better one. :) Boris