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;
In reply to Re: Useful number of childs revisited
by BrowserUk
in thread Useful number of childs revisited [SOLVED]
by karlgoethebier
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |