We have some data structures that we are sharing across processes on Windows. (Via a shared data segment in a DLL that's loaded by all these processes.)
We need to synchronize some accesses and we measured that the performance hit of using a Win32 Mutex is too costly.
CRITICAL_SECTION
cannot be put into shared memory due to some of it's advanced features.
This leaves us with the requirement of a simple locking/mutex solution based directly on the Interlocked*
family of function on Win32.
Before rolling my own I'd like to see if there's robust implementations out there that handle the requirement of being lightweight, fast and working in shared memory for multiple processes, but it seems that this is something that's a tad hard to google for me. (And, anyway, the CodeProject hits, well it's often hard to tell whether it's toy code or "robust".)
So what I'd need could probably be called a user-mode recursive mutex that works for multiple processes when put in shared memory on Windows (note that only the locking part needs to be handled savely, I can live with restrictions / additional requirements for initialization).