in reply to fork and zombies
It means the process has ended, but it hasn't been reaped (using waitpid) by its parent yet.
The following code should reap the children as they end, instead of in the order they were created:
foreach my $row (@$sections) { if (my $pid = fork) { $pids{$pid}++; } else { ... } } while (%pids) { my $pid = waitpid(-1, 0); delete $pids{$pid}; }
By the way, have you considered Parallel::ForkManager? It seems ideal in this situation.
Update: Added code.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: fork and zombies
by Gangabass (Vicar) on Oct 24, 2007 at 07:52 UTC |