in reply to Re: Parallel::ForkManager is time consuming...takes too long
in thread Parallel::ForkManager is time consuming...takes too long
so the code looks likesub some_subroutine { my ($string) = @_; my ($output1, $output2, $output3); if ( $string eq $some_other_string_a ) { $output1 = 1350; $output2 = 9234; $output3 = 8889; } if ( $string eq $some_other_string_b ) { $output1 = 1345; $output2 = 2234; $output3 = 3689; } if ( $string eq $some_other_string_c ) { $output1 = 2256; $output2 = 3370; $output3 = 1340; } @retval = ($output1,$output2,$output3); }
Or do you have an simple example that really works?#!/usr/bin/perl use Parallel::ForkManager; @all_strings=('110110101000101111', '110010101001011101', '110110111001001110', '110011101001011100', '111010101001011100'); my $pm = new Parallel::ForkManager(4); foreach $string (@all_strings) { my $pid = $pm->start and next; ($ouput1, $output2, $output3 ) = some_subroutine($string); $pm->finish; } $pm->wait_all_children;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Parallel::ForkManager is time consuming...takes too long
by runrig (Abbot) on Aug 12, 2011 at 18:49 UTC | |
by esolkc (Acolyte) on Aug 12, 2011 at 23:26 UTC | |
by runrig (Abbot) on Aug 14, 2011 at 17:04 UTC | |
|
Re^3: Parallel::ForkManager is time consuming...takes too long
by ikegami (Patriarch) on Aug 12, 2011 at 19:07 UTC | |
|
Re^3: Parallel::ForkManager is time consuming...takes too long
by ikegami (Patriarch) on Aug 12, 2011 at 20:49 UTC | |
by esolkc (Acolyte) on Aug 12, 2011 at 23:08 UTC | |
by ikegami (Patriarch) on Aug 13, 2011 at 00:05 UTC |