My performance-sensitive application uses MemoryMappedFiles to transfer massive data between many AppDomains. I need the fastest mechanism to signal to the receiving AD that there is new data to read.
The design is as follows:
AD 1: Writer for MMF, when data is written, it should notify AD readers
AD 2,3, N ..: Read MMF
Readers do not need to know how much data is written, because each written message will start with a non-zero int, and it will read to zero, do not worry about partially written messages.
(I think). Traditionally, during one AD, Monitor.Wait / Pulse can be used for this, I do not think that it works through AppDomains.
You can also use the MarshalByRefObject remote access method or event, but I would like something faster. (I estimate 1,000,000 MarshalByRefObject calls / sec on my machine, not bad, but I want more)
A named EventWaitHandle is about twice as fast as the initial dimensions.
Is there anything faster?
Note. Receiving ADs do not need to receive each signal until the last signal is deleted.
Joe
source share