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. I have one module which creates the entries and then a number of seperate modules which need to access these bit strings. Accessing this as a persistent hash/database is much to slow for running calculations. Copying the strings to my local program from the persistent hash works OK but seems a great waste of memory as I have 10+ programs copying over the same data. So I am looking for a straight forward way to access this hash directly in memory (without copying the results).
IPC::Sharable works for small segments but I need a bunch of fairly large strings. Memcached would solve some other issues later on but I haven't been able to work with the data without copying the data to a local variable.
What is the best method to handle access to variables in shared memory directly?