in reply to Useful number of childs revisited [SOLVED]
Humour me and post your results from running this simplified version of your code with arg 4(assuming you have 4 cores?) & 50:
#!/usr/bin/env perl use strict; use warnings; use Math::BigInt; use Parallel::ForkManager; use Time::HiRes qw ( time ); use feature qw(say); my $processes = shift; my $pm = Parallel::ForkManager->new( $processes ); say qq(processes: $processes); my $start=time; for my $number ( 1 .. 50 ) { $pm->start( $number ) and next; my $factorial = Math::BigInt->bfac( 2000 ) for 1 .. 10; $pm->finish( 0 ); } $pm->wait_all_children; say qq(fork: ), time - $start;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Useful number of childs revisited
by karlgoethebier (Abbot) on May 08, 2015 at 12:53 UTC | |
by BrowserUk (Patriarch) on May 08, 2015 at 12:57 UTC | |
by karlgoethebier (Abbot) on May 08, 2015 at 13:07 UTC | |
by BrowserUk (Patriarch) on May 08, 2015 at 13:30 UTC | |
by karlgoethebier (Abbot) on May 08, 2015 at 13:58 UTC |