Windows programming: Event states

Just some basics about the Windows Event object. Event objects can be used for inter process synchronization.

They have only 2 states: signalled and non-signalled. When the Event object is in the non signalled state, it means that it is being used by a thread. All other threads which want to use it will have to go to sleep while this state is maintained. When the current thread which owns the object releases it, the object goes into the signalled state and wakes up a thread which was waiting for it.

SetEvent() sets the state of the object to the signalled state while ResetEvent() sets it to the non-signalled state.When creating an event object, we can specify which state it is created in.


Comments

  1. The Wait functions return when the state becomes signalled.

    ReplyDelete

Post a Comment

Popular posts from this blog

endmenu in different file than menu?

Multi Threading in Android

A binary with debug symbols with the Android NDK