in reply to Re: Killing a child process, kills parent process
in thread Killing a child process, kills parent process
This is another way that works on some OS's.$SIG{CHLD} = sub {while (waitpid(-1, WNOHANG) > 0){} };
for those who are interested, the $SIG{CHLD} happens at the sigaction() level. And is faster because no subroutine will be called if the OS supports this option. I am just saying that it is not universally supported.$SIG{CHLD} = 'IGNORE' # This often works with a few exceptions. # set 'IGNORE' is fastest if it does work. # But there is something to be said for work +ing # all the time, albeit slower (see first sol +ution)
|
|---|