What is the simplest way to wait for more objects than MAXIMUM_WAIT_OBJECTS
?
MSDN lists this:
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
.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.
If you find yourself waiting on tons of objects you might want to look into IO Completion Ports instead. For large numbers of parallel operations IOCP is much more efficient.
And the name IOCP is misleading, you can easily use IOCP for your own synchronization structures as well.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With