We have some data structures that we share on Windows. (Through a shared data segment in a DLL that is loaded by all of these processes.)
We need to synchronize some calls, and we measured that the performance hit when using Mutex Win32 is too expensive.
CRITICAL_SECTION cannot be placed in shared memory due to some of its advanced features.
This leaves us with the requirement of a simple lock / mutex solution based directly on the Win32 Interlocked* family of functions.
Before rolling on my own, I would like to see if there are reliable implementations that cope with the requirement of being lightweight, fast and working in shared memory for several processes, but it seems like this is what Google is hard to do for me. (And, in any case, CodeProject hits, but it is often difficult to say whether it is a code toy or "reliable."
So I would probably need to name a recursive user-mode mutex that works for several processes when placed in shared memory on Windows (note that only part of the lock should be handled with great confidence, I can live with restrictions / additional requirements for initialization).
source share