Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^2: parallelising processes

by hermida (Scribe)
on Feb 06, 2011 at 21:29 UTC ( [id://886562]=note: print w/replies, xml ) Need Help??


in reply to Re: parallelising processes
in thread parallelising processes

Also have a look at Parallel::Forker, I use it all the time it works great exactly as you expect and has advantages over Parallel::ForkManager like child process signalling.
use Parallel::Forker; my $forker = Parallel::Forker->new(use_sig_child => 1, max_proc => 8); $SIG{CHLD} = sub { Parallel::Forker::sig_child($forker); }; $SIG{TERM} = sub { $forker->kill_tree_all('TERM') if $forker && $forke +r->in_parent; }; for (1..10) { $forker->schedule(run_on_start => sub { # do child process code here })->ready(); } # wait for all child processes to finish $forker->wait_all();
hth

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://886562]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2024-04-25 09:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found