Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Odd Parallel::ForkManager behavior

by mod_alex (Beadle)
on May 20, 2003 at 06:38 UTC ( [id://259380]=note: print w/replies, xml ) Need Help??


in reply to Odd Parallel::ForkManager behavior

Dear Hacker
I don't quite understand your problems with ForkManager

Leave "... and next;" as is. It is needed not to process child code in the parent process.
here is a working example
#! c:/perl/bin/perl.exe -w use strict; use Parallel::ForkManager; my @ary = (1..100); my $count = 1; my $pm = new Parallel::ForkManager(30); foreach my $val (@ary) { $count++; $pm->start and next; print "Working on $val (count: $count)\n"; open(ARY, ">child$count") or die $!; print ARY "$val, $count"; close ARY; $pm->finish; }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2024-04-25 16:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found