Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

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
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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2015-07-05 04:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (60 votes), past polls