David,
On 2 Jul 2014, at 13:41, David Matthews <David.Matthews at prolingua.co.uk> wrote:
On 02/07/2014 13:20, Rob Arthan wrote:
Have you looked at System V shared memory (shmget/shmat etc.)? This seems to be available on most flavours of UN*X these days. However, it is a long while since I have used these interfaces and they may just move the problem from the world of ls and rm to the world of ipcs and ipcrm.
Thanks for suggesting this. I was hoping someone might be able to suggest something. However, looking a bit more closely, I can see a problem. shmget uses a "key" which has to be derived from an existing file via ftok. That looks as though it would require a file to be created in the file system for each process. It could be zero size but I think it leads to the problem you've identified.
I don?t think you have to use ftok (in fact, I have never used it). However you do need some scheme for allocating the numbers. I don?t know if you can arrange to have shared memory segments automatically disappear when all related processes die (which is why I thought you might just be moving the problem into a different namespace).
Regards,
Rob.