Re: Waiting for event
- From: "Jim Clark" <nospam-jameswclark@xxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 28 Oct 2008 08:57:43 -0000
The clients perform a clean-up task that may take several seconds. The
clients are using WaitForMultipleObject on the event (they are also waiting
for other things).
I've read and re-read the MSDN docs and it seem to imply that:
1. Auto-resetting = Will ONLY release one waiting thread (this is
intentional)
2. Manual resetting = Will release all waiting threads, but this isn't made
explicitly clear.
What would be the best technique to ensure no waiting thread misses the
event?
James
"Alexander Grigoriev" <alegr@xxxxxxxxxxxxx> wrote in message
news:en7DsUKOJHA.4760@xxxxxxxxxxxxxxxxxxxxxxx
It depend on what the client do when the event is signalled.
"Jim Clark" <nospam-jameswclark@xxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:49061ed3$1_3@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I've got a situation where multiple client processes are waiting for an
event that is signalled by a server process. The event is created by the
server process which then launches the clients. The clients then wait on
the event. The event can be signalled multiple times.
I originally wanted to make the event auto-resetting, but when I read up
on it in MSDN it said that auto-resetting events are reset as soon as the
first waiting thread is signalled.
What is the correct way to handle this situation please? I know I cannot
use a self-resetting event, but what should I do after signalling the
event to ensure that all the clients have synchronized on it - will ALL
clients always synchronize even if the event is rapidly reset?
James
.
- Follow-Ups:
- Re: Waiting for event
- From: Tim Roberts
- Re: Waiting for event
- From: Alexander Grigoriev
- Re: Waiting for event
- References:
- Waiting for event
- From: Jim Clark
- Re: Waiting for event
- From: Alexander Grigoriev
- Waiting for event
- Prev by Date: Re: Is GetCurrentThread really a constant?
- Next by Date: Re: Waiting for event
- Previous by thread: Re: Waiting for event
- Next by thread: Re: Waiting for event
- Index(es):
Relevant Pages
|