How does this perform on your box?
#!/usr/bin/env perl use strict; use warnings; use threads; use MCE::Hobo; use feature qw(say); use constant AMOUNT => 0.001; my $cores = MCE::Util::get_ncpu(); MCE::Hobo->init( max_workers => $cores ); for my $id ( 1 .. 50 ) { my $hobo = MCE::Hobo->create( \&mysub, $id ); say qq($id ) . $hobo -> pid(); } # MCE::Hobo->wait_all(); sub mysub { # my $id = shift; # say $id; for ( 1 .. 100 ) { qx( sleep @{[ AMOUNT ]};) } } __END__
«The Crux of the Biscuit is the Apostrophe»
In reply to Re: Perl threads loss of performance with system call
by karlgoethebier
in thread Perl threads loss of performance with system call
by daniel85
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |