What is the simplest way to wait for more objects than MAXIMUM_WAIT_OBJECTS
?
MSDN lists this:
- Create a thread to wait on
MAXIMUM_WAIT_OBJECTS
handles, then wait on that thread plus the other handles. Use this technique to break the handles into groups ofMAXIMUM_WAIT_OBJECTS
. - Call
RegisterWaitForSingleObject
to wait on each handle. A wait thread from the thread pool waits onMAXIMUM_WAIT_OBJECTS
registered objects and assigns a worker thread after the object is signaled or the time-out interval expires.
But neither are them are very clear. The situation would be waiting for an array of over a thousand handles to threads.
See Question&Answers more detail:os