On Wed, Oct 10, 2012 at 01:40:22AM -0700, Max V. Bouglacoff wrote: > I'm trying to use Event module along with IPC::Shareable. The problem is > that Event does not react on changes of scalar vars placed in shared memory. > The code looks like this: > > ... > > tie $VAR, 'IPC::Shareable', 'SCAL'; > ... > Event->var( > var => \$VAR, > poll => 'w', > cb => sub { > # some code > > } > ); > ... > To clarify: when first process modifies $VAR the > changes are visible in second process immediately, but > there is no reaction on Event facility (in second process). > > Would you be so kind to help me with this? Event's var watcher depends on perl triggering the watcher when modifying the variable. This will not happen when the variable is modified by another process. Rather than using shared memory, I recommend you create a socket pair (like a pipe) between the two processes. Then you can write a byte on one side and use the Event io watcher to notice in the receiving process. Will this work for your use case? > ========= > This is perl, v5.8.8 built for i486-linux-thread-multi > Event-1.20 > IPC-Shareable-0.60 > > Linux breslau 2.6.36 #2 SMP PREEMPT Thu Jan 13 10:56:43 EET 2011 i686 AMD Athlon(tm) 64 X2 Dual Core Processor 5200+ AuthenticAMD GNU/Linux > Slackware 12.1.0 -- Joshua N. Pritikin Department of Psychology University of Virginia Gilmer Hall 102; Charlottesville, VA 22903 http://people.virginia.edu/~jnp3bc