Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Re: Share hash across processes

by TilRMan (Friar)
on Jun 09, 2007 at 04:49 UTC ( #620146=note: print w/ replies, xml ) Need Help??

in reply to Share hash across processes

Have a look at mmap(3). Caveat: I've never used any of the Perl interfaces to mmap.
Comment on Re: Share hash across processes
Replies are listed 'Best First'.
Re^2: Share hash across processes
by bart (Canon) on Jun 09, 2007 at 06:43 UTC
    Yet there are quite a few of them on CPAN.

    I recall somebody even made a mmap module that works on Win32; the author was here and on the chatterbox while he was working on it, but I don't remember what user that was.

    Maybe it was IPC::Mmap? Ah, no, it must have been Win32::MMF, the name rings a bell. Well, both look like reasonable approaches to me, and both have gotten recent updates, which is a promise it'll most likely still work well. But don't discard the other candidates just yet.

    From the top of the thread:

    I have a hash (with about 20-25 keys) with very long bit strings as values (1-2MB) that I would like to share directly (readonly) in memory.
    That looks like an acceptably small number of keys, so the most sane approach to me seem to make a separate mmapped file per hash item. If the keys form a fixed set, you don't even actually have to share the list of names.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://620146]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (9)
As of 2016-05-24 11:56 GMT
Find Nodes?
    Voting Booth?