Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Re: fork report child finish by order child process finish.

by aitap (Deacon)
on Sep 10, 2012 at 09:20 UTC ( #992707=note: print w/replies, xml ) Need Help??

in reply to fork report child finish by order child process finish.

Unless you are training yourself, it should be easier to use Parallel::ForkManager and its run_on_finish callback.

Manual way to do this is sequentially running waitpid with WHOHANG flag and checking its return value for all pids running. Example (untested):

foreach my $process (@child_pids) { if (waitpid($process->{PID}, WNOHANG)) { print "Process $process->{PROCESS} terminated\n"; } }

Sorry if my advice was wrong.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (6)
As of 2016-10-20 22:48 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (283 votes). Check out past polls.