P is for Practical | |
PerlMonks |
Re: How to share huge data structure between threads?by LogicalChaos (Beadle) |
on Jan 10, 2003 at 18:09 UTC ( [id://225889]=note: print w/replies, xml ) | Need Help?? |
Well, you don't say how big huge is, so...Have you looked into IPC::Shareable? You can tie your hash to the shared memory region, and then just make sure you lock it appropriatly before reading/writing. I use this in multi process (not threads) programs and it works quite well for me.If the standard shared memory segment size is too small (32Mb?), you can increase it runtime by adjusting /proc/sys/kernel/shmmax or re-building the kernel
Cheers,
Rob
In Section
Seekers of Perl Wisdom
|
|