in reply to Re^5: Multiple write locking for BerkeleyDB
in thread Multiple write locking for BerkeleyDB
Thats a lot of useful information, thanks.
I'm a little puzzled however of how to get separate processes to use the same shared memory. With fork I can use some form of handle which is inherited, but how does it work when the writer processes have been started separately?
I had a look IPC::MM as it allows the creation of shared hashes (not using storable) but it has the above problem (I think).
Re^7: Multiple write locking for BerkeleyDB
by sgifford (Prior) on Apr 24, 2008 at 17:07 UTC
See the links in my original post; all share memory between unrelated process. IPC::MM looks very useful, but only shares memory between related processes, at least according to the MM docs at OSSP (I haven't used it myself).
If you're not interested in doing the low-level work yourself (which will probably give the best performance at the expense of a lot of work), Cache::FastMmap might be helpful. It acts as a fast cache that sits in front of something else, like a database or DB file. You would mostly use the cache, and could periodically flush it out to the database to limit how much data you lose if your machine crashes. The author of this module has some interesting performance information at Comparison of different PERL caching modules.