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 of MAXIMUM_WAIT_OBJECTS
.
- Call
RegisterWaitForSingleObject
to wait on each handle. A wait thread from the thread pool waits on MAXIMUM_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 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…