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

Discussion in 'Perl Misc' started by lsyx, Sep 3, 2007.

  1. lsyx

    lsyx Guest

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

    But it can't work in windows.

    thanks!
    lsyx, Sep 3, 2007
    #1
    1. Advertising

  2. lsyx

    Ben Morrow Guest

    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
    Ben Morrow, Sep 3, 2007
    #2
    1. Advertising

  3. lsyx

    lsyx Guest

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

    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. :)
    lsyx, Sep 4, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Saraswati lakki
    Replies:
    0
    Views:
    1,323
    Saraswati lakki
    Jan 6, 2012
  2. Sébastien Cottalorda

    IPC::Shareable Problem with multidimentional hash

    Sébastien Cottalorda, Sep 9, 2005, in forum: Perl Misc
    Replies:
    8
    Views:
    214
    Sébastien Cottalorda
    Sep 13, 2005
  3. sridevi

    IPC::Shareable

    sridevi, Dec 8, 2006, in forum: Perl Misc
    Replies:
    2
    Views:
    102
    Sisyphus
    Dec 8, 2006
  4. David Jacobowitz

    Net::Server + IPC::Shareable == decent performance ?

    David Jacobowitz, Nov 8, 2007, in forum: Perl Misc
    Replies:
    1
    Views:
    146
  5. Snorik

    IPC:Shareable

    Snorik, Sep 18, 2008, in forum: Perl Misc
    Replies:
    19
    Views:
    534
    Snorik
    Sep 29, 2008
Loading...

Share This Page