in reply to Many children, but never more than a fixed number at once.
Code stolen from docs :)use Parallel::ForkManager; $pm = new Parallel::ForkManager($MAX_PROCESSES); foreach $data (@all_data) { # Forks and returns the pid for the child: my $pid = $pm->start and next; ... do some work with $data in the child process ... $pm->finish; # Terminates the child process }
gav^
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Many children, but never more than a fixed number at once.
by Abigail-II (Bishop) on Jul 08, 2002 at 16:33 UTC |