Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Strange (for me) behavior of Parallel::ForkManager

by ikegami (Pope)
on Oct 10, 2012 at 01:50 UTC ( #998111=note: print w/ replies, xml ) Need Help??


in reply to Strange (for me) behavior of Parallel::ForkManager

$manager->finish(\&next); is exit(\&next). Aside from the fact that the argument makes no sense, you're exiting the child at the wrong spot. When that child is done processing a line, it needs to exit by calling finish.

use Parallel::ForkManager; my $manager = new Parallel::ForkManager( 20 ); while (<LIST>){ $manager->start and next; my (..., $ip, ...) = split( /\s+/, $_ ); print "ip ? $ip\n"; $manager->finish() if !$p->ping($ip); ... $manager->finish(); } print "flag\n";


Comment on Re: Strange (for me) behavior of Parallel::ForkManager
Select or Download Code
Re^2: Strange (for me) behavior of Parallel::ForkManager
by Sterh (Novice) on Nov 06, 2012 at 17:45 UTC
    And it still executes everything , but does not exit the loop...:(

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2015-07-04 00:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (57 votes), past polls