tags:

views:

44

answers:

2

If 2 or more threads are waiting on an event, does SetEvent unblock one or all of them(Or some of them) ?

+2  A: 

It depends on if it is a manual or auto-reset event. If it is a manual reset, then multiple threads can be released until it is reset. If it is auto-reset, then only one will be signaled.

Mark Wilkins
+1  A: 

An auto-reset event will be reset after waking one thread. A manual-reset even will remain set until it's reset, so it can wake up an arbitrary number of threads. It is a bit difficult to know when to reset it if you want to assure that all threads waiting on it wake up exactly once (but then again, if you care about that, it points to a probable design problem).

Jerry Coffin