9 ms·
Really, the oddity is that Microsoft thinks there's a significant difference between in-process communication and cross-process communication. They're all runni
by o11c 1y ago
Really, the oddity is that Microsoft thinks there's a significant difference between in-process communication and cross-process communication. They're all running on the same physical memory and the kernel can share access to that.
- Dwedit 1y agoI mean you can put a critical section inside of shared memory, but the heavy mutex is used for situations where you need to actually name the mutex, then have another process open it by name. Example uses include preventing multiple instances of a single program from running. Not the kind of thing you'd use a std::mutex or critical section for.
- Dwedit 1y agonote: Do not actually put a critical section inside of shared memory. They allocate semaphores specific to one process.
- drysart 1y agoOn Windows they are significantly different; it's not just a matter of sharing a page of memory (though you certainly can do that if you want), because on Windows basically every kernel-provided cross-process object must be a fully securable kernel object that you can attach ACLs to, and the kernel has to be in the middle of operations to enforce those access controls (in order to conform to the old DoD TCSEC orange book requirements for mandatory access security).