Greetings,

I found time to complete this including releasing 1.002 on CPAN.

In the future, I will remove MCE::Mutex from MCE and have it depend on the new Mutex module. Regarding MCE::Shared, eventually that will no longer depend on MCE now that Mutex is a separate module.

Currently, there are two implementations. The default is "Channel" when "impl" is not given.

use strict; use warnings; use Mutex; my $m1 = Mutex->new( ); my $m2 = Mutex->new( path => /tmp/my.lock ); my $m3 = Mutex->new( impl => "Channel" ); my $m4 = Mutex->new( impl => "Flock" ); $m1->impl(); # Channel $m2->impl(); # Flock $m3->impl(); # Channel $m4->impl(); # Flock $m1->lock; $m1->unlock; $m2->lock_exclusive; # Fcntl LOCK_EX $m2->lock # ditto LOCK_EX $m2->lock_shared; # Fcntl LOCK_SH $m2->unlock; # Fcntl LOCK_UN

Regards, Mario

Edit: Updated the CPAN link to point to the 1.001 release.
Edit: Updated link to the 1.002 release.


In reply to Re: Mutex::Flock - Fcntl advisory locking supporting processes and threads. by marioroy
in thread Mutex::Flock - Fcntl advisory locking supporting processes and threads. by marioroy

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.