Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^3: Enlighten by Abigail-II's example. Tis a MCE::Hobo demonstration.

by marioroy (Prior)
on Mar 19, 2017 at 11:37 UTC ( [id://1185169]=note: print w/replies, xml ) Need Help??


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;
  • Comment on Re^3: Enlighten by Abigail-II's example. Tis a MCE::Hobo demonstration.
  • Download Code

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
    From 1.817 onwards, MCE::Hobo will spawn a process via fork on Windows,

    Really? That's a clever trick given Windows doesn't do fork!? Or do you mean that you are now using Perl's thread-based fork-emulation rather then the threads apis directly?


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority". The enemy of (IT) success is complexity.
    In the absence of evidence, opinion is indistinguishable from prejudice.

      Hi BrowserUk. Yes, MCE::Hobo 1.817 onwards is using Perl's thread-based fork-emulation.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1185169]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2024-04-16 07:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found