Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can a single SetEvent() trigger multiple WaitForSingleObject()

Tags:

c++

events

winapi

This:

http://msdn.microsoft.com/en-us/library/ms686915(VS.85).aspx

Would seem to suggest not.

I have three processes communicating via pipes. Process A Creates an event, Process B & C each use WaitForSingleObject (in a second thread).

So now we have -TWO- Processes each waiting for a -SINGLE- event.

Process A fires the event with SetEvent(), Process B responds, process C does not.

Conclusion:

Each WaitForSingleObject() requires a unique Event... Correct?

like image 300
Mike Trader Avatar asked Mar 07 '09 11:03

Mike Trader


1 Answers

Use manual reset events to trigger multiple threads off of a single event.

Here is an example which uses "Manual Reset Event" flag

like image 168
Vinay Avatar answered Oct 21 '22 07:10

Vinay