in reply to Re^2: Enlighten by Abigail-II's example. Tis a MCE::Hobo demonstration.
in thread Enlighten by Abigail-II's example. Tis a MCE::Hobo demonstration.
MCE::Shared 1.817 has been released. The reason is to have MCE::Hobo run consistenly on all platforms including Windows. From 1.817 onwards, MCE::Hobo will spawn a process via fork on Windows, similar to running on any Unix OS.
use strict; use warnings; use MCE::Hobo; use Time::HiRes 'time'; sub mhobo ($$&) { my ($count, $max, $code) = @_; foreach my $c (1 .. $count) { MCE::Hobo->waitone() unless $c <= $max; exit(255) unless defined (my $h = MCE::Hobo->create($code, $c) +); } MCE::Hobo->waitall(); } my $start = time; mhobo(12, 4, sub { my $x = 3e7; $x-- while $x; print "$$\n"; }); printf "Seconds: %0.03f\n", time - $start;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Enlighten by Abigail-II's example. Tis a MCE::Hobo demonstration.
by BrowserUk (Patriarch) on Mar 19, 2017 at 12:55 UTC | |
by marioroy (Prior) on Mar 19, 2017 at 17:54 UTC |