in reply to Re^2: wait_all_children for Proc::Fork?
in thread wait_all_children for Proc::Fork?
# wait to reap all children for my $pid (@child_pids) { local $SIG{__DIE__}; local $@ = ""; eval { local $SIG{ALRM} = sub { die("alarm\n") }; alarm(3600); # potentially long operation waitpid $pid, 0; alarm(0); 1; } or do { die($@) unless $@ eq "alarm\n"; # timed out warn("Waited too long for child $pid. Skipping it.\n"); } }
|
|---|