Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Where does the 6th process come from?

by marioroy (Prior)
on Apr 22, 2017 at 16:12 UTC ( [id://1188626]=note: print w/replies, xml ) Need Help??


in reply to Where does the 6th process come from? [SOLVED]

On Unix platforms including Cygwin, the MCE::Shared module spawns a shared-manager process unless threads is present.

1 for the main process 1 for the shared-manager process (a thread when threads is present) 4 for the hobo processes

The Sereal modules (Decoder/Encoder) are loaded automatically. Basically, the Storable module is not loaded when Sereal 3.015 or later is available. The following are recommended modules. IO::FDPass allows the passing of the fd descriptor while the shared-manager is running.

## MCE and MCE::Shared including MCE::Hobo 1. Sereal::Decoder 3.015+ 2. Sereal::Encoder 3.015+ 3. Sereal (ok for completeness, but MCE does not load this) ## MCE::Shared applies to Condvar, Handle, and Queue 1. IO::FDPass 1.2+

Replies are listed 'Best First'.
Re^2: Where does the 6th process come from?
by karlgoethebier (Abbot) on Apr 22, 2017 at 17:03 UTC
    "...unless threads is present"

    Thank you very much marioroy!

    But threads is present:

    karls-mac-mini:monks karl$ cpanm threads threads is up to date. (2.15)

    Best regards, Karl

    «The Crux of the Biscuit is the Apostrophe»

    Furthermore I consider that Donald Trump must be impeached as soon as possible

      ... if present meaning if threads is loaded inside the script.

      use threads; ...

      On Unix platforms including Cygwin, one can use threads and threads::shared alongside MCE::Shared. In that case, MCE::Shared spawns a thread for the shared-manager. For the Windows platform, the MCE modules loads threads automatically for extra stability.

      Below, more clarity for the recommended modules.

      (Q) Why is Sereal loaded transparently?

      (A) The main reason is for extra performance. To ensure minimum memory consumption, there's no reason to load the Storable module if Sereal is available in Perl. This is handled transparently.

      (Q) Why is IO::FDPass beneficial?

      (A) Being able to construct a shared condvar, handle, or queue while the shared-manager is running greatly adds to the ease-of-use. These involve handles behind the scene. Basically, am able to send the relevant fd descriptors to the shared-manager. Without FDPass, one must be careful to construct these shared objects first and later start the shared-manager manually.


        Ahh! I begin to see it clearly now. It works as expected:

        use strict; use warnings; use threads; use threads::shared; use MCE::Hobo; use MCE::Shared; use feature qw(say); # ... stuff # !!! procs at pending: karl31075,20,1246243212240s000S+7:55pm0:00.08perl./hobo.pl karl31150,00,000s000Z+7:55pm0:00.00(perl) karl31140,00,000s000Z+7:55pm0:00.00(perl) karl31130,00,000s000Z+7:55pm0:00.00(perl) karl31120,00,000s000Z+7:55pm0:00.00(perl) procs after join: karl310723,10,1247164812260s000S+7:55pm0:00.09perl./hobo.pl

        Secret knowledge from The Masonic Lodge Of Parallelism.

        Best regards, Karl

        «The Crux of the Biscuit is the Apostrophe»

        Furthermore I consider that Donald Trump must be impeached as soon as possible

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (7)
As of 2024-04-16 17:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found