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.
If there is no alternative to the present scheme of creating a mapped file in the file system then it would probably be better to only create it if the creating process explicitly requests it. That could be a flag somewhere in PolyML.Statistics or, probably easier, a command line option. Any ideas?
If you stick with mmap, then control via the command line looks good to me.
I'll have a think about this but it looks like it might be the best solution.
David