in reply to Re: Best way to kill a child process
in thread Best way to kill a child process
$SIG{CHLD} = sub {while (waitpid(-1, WNOHANG) > 0){} };
AFAIK, on most platforms (where reaping children is of concern), setting
$SIG{CHLD} = 'IGNORE';
should have the same effect, as it will make Perl autoreap terminated child processes. And it's less clutter (you don't need to load/import WNOHANG from POSIX ...).
See also perlipc.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Best way to kill a child process
by Marshall (Canon) on Sep 21, 2011 at 15:31 UTC | |
by Eliya (Vicar) on Sep 21, 2011 at 18:41 UTC | |
by Marshall (Canon) on Sep 22, 2011 at 00:50 UTC | |
by flexvault (Monsignor) on Oct 10, 2011 at 15:16 UTC | |
by Marshall (Canon) on Oct 15, 2011 at 21:18 UTC | |
|
In Section
Seekers of Perl Wisdom