Hi Mario,

I'm going on vacation soon, so I'll print on the manuals to MCE::* and try to comment on how this research compares.

DESCRIPTION A Hobo is a migratory worker inside the machine that carries the asynchronous gene. Hobos are equipped with "threads"-like capability for running code asynchronously. Unlike threads, each hobo is a unique process to the underlying OS. The IPC is managed by "MCE::Shared", which runs on all the major platforms including Cygwin.
It seems you are way ahead of me in thinking about this. That's a cool venture (MCE::*); I see tonnes of applications for it.

I appreciate the diff. Thank-you.

Do you have terminology for the scope of data shared between processes?

So PIE in the sky question is...

How would I have a data shared for the lifetime of a block, and I want that block to run first, amongst all the processes that share it?

{ use MCE::Shared; my $cnt; #tie my $cnt, 'MCE::Shared', { module => 'MCE::Shared::Scalar' }, 0; tie my $va1, 'MCE::Shared', { module => 'MCE::Shared::Scalar' }, sub { + return $cnt++; }; #just for fun let's make a closure # How can I be sure that ($val->() == 0)? say ($val->()) ? 0 : 1; # says 1 if first caller }
My Brain is saying that setting a mutex to protect the call to $val would be a recursive solution with no end? Eg. No atomic-ity, eg deadlock. Yeah, if it was synchronous it would work, but it's not.

I said deadlock is on the horizon because the block could be wrapped in another block with a different mutex controlling the lower one. Got to run to an appointment. I'm going to be late. All the best, Jambo


In reply to Re^2: Why won't this Deadlock? by Jambo Hamon
in thread Why won't this Deadlock? by Jambo Hamon

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.