Is there any good examples on how to do a interlock two processes. I need to lock out one process while I have another process access the shared memory.
Generally this is done by putting having a Mutex in shared memory. Here are a couple of topics that roughly cover what you want to do.
The other option is to create a resource manager to control access to the shared memory. This topic covers that concept.