
wickedxter
User
Oct 23, 2012, 6:19 PM
Views: 776
|
|
Re: [gw1500se] Understanding Parallell::ForkManager
|
|
|
are u workin on windows or linux? because fork on windows doesnt work as well at it does on linux this is the basic way to use it..
use strict; use warnings; use Parallell::ForkManager; my $fork = Parallell::ForkManager->new(4); #number of max forks for(0..1000){ my $pid = $fork->start and next; #work here for the forks to do; print "PID: $pid ::: WORK: $_ \n"; $fork->finish; } $fork->wait_all_children;
(This post was edited by wickedxter on Oct 24, 2012, 7:27 AM)
|