Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: reaping defunct children

by autark (Friar)
on Feb 16, 2001 at 15:10 UTC ( #58830=note: print w/replies, xml ) Need Help??


in reply to reaping defunct children

If your process gets two or more SIGCHLD signals before being scheduled, only one signal will arrive. This because the kernel keeps track of the signals to your process in a bit vector, one bit per uniq signal. The solution is to loop, like this:
sub REAPER { my $pid; while(( $pid = waitpid(-1, WNOHANG)) > 0) { # Do stuff } $SIG{CHLD} = \&REAPER; }
Autark.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://58830]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2020-12-01 14:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How often do you use taint mode?





    Results (10 votes). Check out past polls.

    Notices?