[cs631apue] Questions about clean zombie children processes
Jan Schaumann
jschauma at stevens.edu
Sat Nov 2 13:33:51 EDT 2013
Hongyi Shen <hshen4 at stevens.edu> wrote:
> Which way does real world server do with this problem?
> If it is #1, when to *signal() *the zombies* *?
The parent process does not _send_ any signals, it _receives_ them. Ie,
if a child terminates, the parent process will receive SIGCHLD and
should then reap the given child process via one of the wait(2) related
functions.
> (I assume that should be each time new process forked, it check whether
> SIGCHLD exist and then handle them)
You can't "check" for signals (unless you explicitly blocked them), you
will simply asynchronously receive them.
-Jan
More information about the cs631apue
mailing list