Re: Two WaitForSingleObject functions wait the same event

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Hello,

It depends if it is a manual reset event or an auto reset event. If it is
auto-reset, then only one thread is signalled. If it is a manual reset
event, then any/all threads waiting will be signalled until the event is
reset. See MSDN http://msdn.microsoft.com/en-us/library/aa909161.aspx for
details of how SetEvent works. Note there are ways to signal more than one
thread using PulseEvent and manul reset events, but there are issues with
that too. Your better off having separate events.

Cheers
Danny


"C.L" <CL@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:743C914E-78C1-48DA-A6BF-862E705B02A8@xxxxxxxxxxxxxxxx
Hi,

I have two threads using WaitForSingleObject function to wait the same
event. When the event is set, are both these two thread triggered?

Thanks.


.