[ofw] anyone know about events and overlapped I/O?

Sean Hefty sean.hefty at intel.com
Wed Mar 4 10:51:27 PST 2009


Does anyone know if it's safe for multiple overlapped I/O operations to
reference the same event?  I bring this up because I'm trying to do just this,
and my application hangs waiting for events.  I'm using manual reset events,
though I've tried with auto-reset as well.

As a point of reference, this is in the documentation for the hEvent field in
the OVERLAPPED structure:

"Functions such as ReadFile and WriteFile set this handle to the nonsignaled
state before they begin an I/O operation. When the operation has completed, the
handle is set to the signaled state."  This makes me think that it's possible to
lose events if shared between overlapped structures.

Although under the Remarks section it states: "You should also create an event
object for each thread that processes data."  This makes me think that it's
doable.

- Sean




More information about the ofw mailing list