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
In reply to Re^6: Best way to kill a child process
by flexvault
in thread Best way to kill a child process
by doylebobs
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |