Den 3. nov. 2012 kl. 01:32 skrev Richard Oudkerk email@example.com:
On 02/11/2012 11:10pm, Sturla Molden wrote:
So you nest them in a tree, each node having up to 64 children...
The root allows us to wait for 64 objects, the first branch allows us to wait for 4096, and the second 262144...
For example, if 4096 wait objects are enough, we can use a pool of 64 threads. Each thread calls WaitForMultipleObjects on up to 64 wait objects, and signals to the master when it wakes up.
Windows already has RegisterWaitForSingleObject() which basically does what you describe:
No, it does something completely different. It registers a callback function for a single event object and waits. We were talking about multiplexing a wait for more than 64 objects.