how to share variable like IPC::Shareable in win32 ?

how to share variable like IPC::Shareable in win32 ?

am 03.09.2007 08:53:54 von lsyx

I use IPC::Shareable to share Perl variables between processes in
linux.

But it can't work in windows.

thanks!

Re: how to share variable like IPC::Shareable in win32 ?

am 03.09.2007 15:27:35 von Ben Morrow

Quoth lsyx :
> I use IPC::Shareable to share Perl variables between processes in
> linux.
>
> But it can't work in windows.

If you want an interface similar to IPC::Shareable, where random
processes created independantly can locate the shared memory given an
appropriate ID, you may have some luck with Win32::MMF.

However, if your processes are all forked perl processes (that is, they
are all children of one parent), you can share variables by switching
from fork to threads and threads::shared. Fork is emulated using threads
under Win32 anyway.

Ben

Re: how to share variable like IPC::Shareable in win32 ?

am 04.09.2007 03:32:06 von lsyx

On 9 3 , 9 27 , Ben Morrow wrote:
> Quoth lsyx :
>
> > I use IPC::Shareable to share Perl variables between processes in
> > linux.
>
> > But it can't work in windows.
>
> If you want an interface similar to IPC::Shareable, where random
> processes created independantly can locate the shared memory given an
> appropriate ID, you may have some luck with Win32::MMF.
>
> However, if your processes are all forked perl processes (that is, they
> are all children of one parent), you can share variables by switching
> from fork to threads and threads::shared. Fork is emulated using threads
> under Win32 anyway.
>
> Ben

thanks so much! The Win32::MMF is what i want.Maybe I can try
threads::shared later. :)