Re: WaitForSingleObject() will not deadlock



CRITICAL_SECTION (EnterCriticalSection, LeaveCriticalSection) provides a
memory fence, too.

CRITICAL_SECTION is fast, intra-process, recursive mutual exclusion
synchronization object.

Kernel mutex (CreateMutex) can be used to synchronize _between_ processes,
too, but since it requires a roundtrip to kernel mode, its overhead is more
than of CRITICAL_SECTION. A kernel mutex also takes care of priority
inversion, which CRITICAL_SECTION does not.

"Frank Cusack" <fcusack@xxxxxxxxxxx> wrote in message
news:m2r6nrtxgj.fsf@xxxxxxxxxxxxxxxxxx
On Sun, 1 Jul 2007 17:01:07 -0700 "Alexander Grigoriev"
<alegr@xxxxxxxxxxxxx> wrote:
This is just a CRITICAL_SECTION rough equivalent.

Sorry to be following up so many times when once would have been
sufficient. I don't know the semantics of CRITICAL_SECTION, but
POSIX mutexes provide memory visibility guarantees that, from the
name of it, CRITICAL_SECTION doesn't sound like it does.

They are different beasts.

-frank


.