in reply to Share hash across processes
If you choose something like DB_File or DBM::Deep, you'll probably find the use of the local filesystem (if available) to be pretty darned efficient. IIRC, DB_File even handles buffering for you (the berkely db magic).
It is possible to write your own hash class with tie. You could make each key a shared scalar (using whatever method you like). Perhaps that's the best way if you have something really specific in mind, because then you can explicitly state what you want and perl will do it. :)
My thinking is that you might be accustomed to sharing huge segments of memory in C/C++. I'm not sure there's anything directly comparable in perl — though I wouldn't be surprised if there were. As a last resort, you could write something in XS or Inline::C. That sounds pretty interesting to me.
-Paul
|
|---|