Not sure if this is specific to Win32::MMF::Shareable (v0.07), but when you $mw->waitVariable( \$tied_var ) while using Tk, it doesn't resume when $tied_var is updated in another process. Like so:
use strict; use Tk; use Win32::MMF::Shareable; my $wait; tie( $wait, 'Win32::MMF::Shareable', 'wait' ); $wait = 0; my $pid; unless( $pid = fork ) { $SIG{HUP} = \&stop; while( 1 ) { sleep 1 } } my $mw = MainWindow->new; $mw->Button( -text => '$wait', -command => sub { pri +nt "\$wait is $wait\n" } )->pack; $mw->Button( -text => 'waitVariable( \\$wait )', -command => \&start ) +->pack; $mw->Button( -text => 'local $wait++', -command => \&stop ) +->pack; $mw->Button( -text => 'remote $wait++', -command => sub{ kill +( 'HUP', $pid ) } )->pack; MainLoop; kill( 'TERM', $pid ); sub start { print "waiting for \$wait (was $wait)\n"; $mw->waitVariable( \$wait ); print "finished waiting for \$wait (is now $wait)\n"; } sub stop { print "\$wait++ by pid $$\n"; $wait++; } __END__ # [\d] is button pressed $wait is 0 # [1] start on 0 waiting for $wait (was 0) # [2] start waiting $wait++ by pid 2372 # [3] increment locally finished waiting for $wait (is now 1) # ... all okay waiting for $wait (was 1) # [2] wait again $wait++ by pid -2184 # [4] increment remotely # ... nothing happens $wait is 2 # [1] but it has been increment +ed $wait++ by pid 2372 # [3] increment locally again finished waiting for $wait (is now 3) # ... and it works

- ><iper

use japh; print;

In reply to Re: (Updated Again) Win32::MMF - Memory Mapped File Support for Perl by xiper
in thread (Updated Again) Win32::MMF - Memory Mapped File Support for Perl by Roger

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.