in reply to Perl threads loss of performance with system call
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»
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Perl threads loss of performance with system call
by Anonymous Monk on Jul 14, 2021 at 05:54 UTC | |
by Anonymous Monk on Jul 14, 2021 at 06:09 UTC | |
by karlgoethebier (Abbot) on Jul 14, 2021 at 10:00 UTC | |
Re^2: Perl threads loss of performance with system call
by daniel85 (Novice) on Jul 11, 2021 at 17:29 UTC | |
by karlgoethebier (Abbot) on Jul 11, 2021 at 19:45 UTC | |
by Anonymous Monk on Jul 14, 2021 at 04:54 UTC | |
by karlgoethebier (Abbot) on Jul 14, 2021 at 21:46 UTC |