Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: fork and zombies

by Zaxo (Archbishop)
on Oct 24, 2007 at 07:11 UTC ( #646840=note: print w/replies, xml ) Need Help??


in reply to fork and zombies

waitpid looks for a particular child, and other signals may be lost. I like to keep the pid's as keys in a hash and delete them as they die:

delete $pid{+wait} while %pid;
Trying to do that in a for loop assumes that child processes will halt in a particular order.

After Compline,
Zaxo

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (6)
As of 2019-06-17 11:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Is there a future for codeless software?



    Results (78 votes). Check out past polls.

    Notices?
    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!