CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate: Re: [gw1500se] Understanding Parallell::ForkManager: Edit Log



wickedxter
User

Oct 23, 2012, 6:19 PM


Views: 1123
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..


Code
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)


Edit Log:
Post edited by wickedxter (User) on Oct 24, 2012, 7:20 AM
Post edited by wickedxter (User) on Oct 24, 2012, 7:27 AM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives