What's the problem with fork? It should be quite simple:
use strict; use warnings; use autodie; my $processes = 0; my @ids = 1 .. 40; for my $id (@ids) { if ( $processes >= 8 ) { wait; $processes--; } if (fork) { $processes++; } else { chdir $id; exec $command, $id; } } wait while $processes--;
In reply to Re: parallelising processes
by zwon
in thread parallelising processes
by RobertCraven
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |