I'm trying to make application A write an byte array into a Memory Mapped Stream, application B then reads this piece of memory. I've got to the point where they can read and write but the problem is I can't get application B to wait for new data to arrive, right now it just reads as fast as possible.
After searching around for a bit I found out that you could assign a callback to MemoryMappedStream.BeginRead but i'm unsure how to use this callback to wait for new data from the stream. How would one make a callback for this kind of situation? Or am I looking into the wrong direction?
EventWaitHandleas a signal to the consuming thread to tell it when the data has been completely written. (You might also want anotherEventWaitHandlefor the consuming thread to indicate to the producing thread that it has consumed the data) - Matthew Watson