http://bugzilla.spamassassin.org/show_bug.cgi?id=3301
------- Additional Comments From [EMAIL PROTECTED] 2004-04-26 12:33 ------- Subject: Re: multiple processes - killing parent doesn't kill the children -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 >> if it is that bug, anomie's "use open pipe fds to track number of children" >> trick may be appropriate again so we don't have to use SIGCHLD. > >FYI: I'm not sure what you mean by that. There's no pipes between >the child and parent, so we can't count anything that way. The only >communication is when a child dies the parent gets a sigchld. The trick is this; when forking a child: - - parent creates pipe pair of (reader, writer) - - parent forks child - - if ($$==child) close reader - - if ($$==parent) close writer - - child does things..... - - child eventually exits, causing writer to close - - parent periodically calls select(). once the child has exited, the reader fd has been closed. the parent can map from fd number of the reader fd to the pid of the child process which exited. In other words, it's a *safe*, efficient, way to discover when a child process has exited, using pipe() as the IPC mechanism to do this. Basically it was required because signals were not safe to use for this, for some reason. - --j. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) Comment: Exmh CVS iD8DBQFAjWPlQTcbUG5Y7woRAnDbAJ4ycJH7D+QgNWiiQREEYvZtKSLCLACeNUPP 0hyjo+xl1Y5hpUuxpQ4QYTw= =MNRj -----END PGP SIGNATURE----- ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
