: I would like to lock down memory (mlock) and then allow 2 processes
: to write to it.
: I have a program that locks down 64Meg (in sevral pieces).
: I cannot make it multithreaded due to a thread UNSAFE third party
: I need to break it up into 2 processes.
[emailed author also]
You really haven't asked a question as I see no '?', so are you asking
for a way to get around having to fork 2 processes and instead use
threads? Are you asking how to keep the 2 processes out of each others
way? It's not clear why you lock down several pieces instead of all at once.
As for the 2 process r/w problem, the obvious solution is to use a semaphore(s).
As for shared memory, I find mmap(2)'d files more useful and let the OS
decided what memory is being accessed and should stay in memory and avoid
the mlock problems all together.
Hope this helps.