Quantcast
Channel: Visual C forum
Viewing all articles
Browse latest Browse all 15302

WaitForMultipleObjects, wait timeout, and manual reset events

$
0
0

Windows 7, Visual Studio 2008, C++,

This project uses overlapped TCP/IP operations with completion events. The events are created with the flag set for manual reset.  After starting, things look fine until the first timeout.  Then the timeout event is hit continuously. It appears that the timeout event is not being reset.  The code has some counters for each event detected, including the timeout out. That value counts very quickly.

That is understandable.  But an attempt to reset the timeout event returns the error of invalid handle.

That makes sense, but it means that with manual reset events, one had best not have a timeout value set.

This page explains  the WaitForMultipleObjects function

http://msdn.microsoft.com/en-us/library/windows/desktop/ms687025(v=vs.85).aspx

This page explains the CreateEvent function

http://msdn.microsoft.com/en-us/library/windows/desktop/ms682396(v=vs.85).aspx

Neither page says anything about dangers of using manual reset events and the wait timeout argument.

Do I understand this correctly?  Am I correct in concluding that WaitForMultipleObjects cannot be used with manual reset events AND with a timeout?


~jag77 We need to know what a dragon is before we study its anatomy. (Bryan Kelly, 2010)


Viewing all articles
Browse latest Browse all 15302

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>