in reply to Re^5: Best way to kill a child process
in thread Best way to kill a child process
Hi Marshall
. . . a coderef to a subroutine that causes a waitpid loop. . .
Just something to think about! I recently (past year) removed all uses of waitpid loops, since on some recent versions of AIX/Unix/Linux, especially on multi-core computers, if the child had been reaped by another core, the SIG handler hanged forever. I replace the code in the parent with:
if ( kill 0 => $child ) { $children++; ... } else { my $ret = &make_child( ); ... }
It works, but like you I prefer the sub. I don't know if this behavior is a bug, or it its intentional. The problem doesn't seem to happen it the child exists, only when it has been reaped in a previous call.
I commented out the previous use, may need it again :-)
Thank you
"Well done is better than well said." - Benjamin Franklin
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: Best way to kill a child process
by Marshall (Canon) on Oct 15, 2011 at 21:18 UTC | |
by flexvault (Monsignor) on Oct 16, 2011 at 13:28 UTC | |
by Marshall (Canon) on Oct 18, 2011 at 00:44 UTC |