Re: WaitForSingleObject() will not deadlock
- From: "Alexander Grigoriev" <alegr@xxxxxxxxxxxxx>
- Date: Sun, 1 Jul 2007 21:35:36 -0700
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
.
- Follow-Ups:
- Re: WaitForSingleObject() will not deadlock
- From: Frank Cusack
- Re: WaitForSingleObject() will not deadlock
- References:
- Re: WaitForSingleObject() will not deadlock
- From: Joseph M . Newcomer
- Re: WaitForSingleObject() will not deadlock
- From: Frank Cusack
- Re: WaitForSingleObject() will not deadlock
- From: Joseph M . Newcomer
- Re: WaitForSingleObject() will not deadlock
- From: Alexander Grigoriev
- Re: WaitForSingleObject() will not deadlock
- From: Frank Cusack
- Re: WaitForSingleObject() will not deadlock
- Prev by Date: RE: エディットテキストで文字化け
- Next by Date: Re: WaitForSingleObject() will not deadlock
- Previous by thread: Re: WaitForSingleObject() will not deadlock
- Next by thread: Re: WaitForSingleObject() will not deadlock
- Index(es):