I wrote this module:
Parallel::ForkControl because I couldn't find any modules at the time that abstracted out the forking code in a way that let me adjust the forking performance so me and my co-workers could focus on the function of the code. I'd be interested in hearing your comments on the functionality of the module.
use Parallel::ForkControl;
my $forker = new Parallel::ForkControl(
MaxKids => 5000,
MinKids => 5,
WatchLoad => 1,
MaxLoad => 5.50,
Code => \&mySub
);
foreach my $col (@collections) {
$forker->run($col);
}
$forker->cleanup();
sub mySub {
my $collection = shift;
......
return;
}
Thanks,
UPDATED: I fixed the code parameter in the example to be a code ref.