Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^9: Why should any one use/learn Perl 6?

by liz (Monsignor)
on Jun 13, 2018 at 22:26 UTC ( #1216598=note: print w/replies, xml ) Need Help??


in reply to Re^8: Why should any one use/learn Perl 6?
in thread Why should any one use/learn Perl 6?

Thank you for your elaboration.

If I understand you correctly, you either have a little boilerplate with tie

tie my $var, 'MCE::Shared', 0; $var = 42;

or you have a lot of boilerplate without tie

my $var = MCE::Shared->share( { module => 'My::Scalar' }, 0 ); $var->set(42)

And underneath you have locking going on in either case. Is that a correct summary?

Please note that I really like what you have done with MCE!

Replies are listed 'Best First'.
Re^10: Why should any one use/learn Perl 6?
by marioroy (Vicar) on Jun 13, 2018 at 23:29 UTC

    Hello liz,

    Under the hood (MCE::Shared::Server), the boilerplate is the same between OO and TIE for the most part. For Perl-like behavior, the TIE interface involves additional overhead from Perl itself.

    MCE::Mutex is used internally for locking. There are 10 locks, one per data channel. A worker from MCE, MCE::Hobo, or threads is assigned a data-channel automatically in a round-robin fashion. 10 workers max can obtain an exclusive lock simultaneously. The unidirectional command-channel involves no locking.

    Other parallel modules on MetaCPAN may benefit from multiple data channels simply by calling MCE::Shared::init() inside the worker.

    Regards, Mario

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (7)
As of 2019-11-14 16:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Strict and warnings: which comes first?



    Results (80 votes). Check out past polls.

    Notices?