… there’s no need to use WaitForMultipleObjects in Step 2. It’s fairly easy to keep a counter of active threads in the pool (interlocked-incremented when a thread starts, interlocked-decremented when a thread is finished). When the counter reaches zero (no more active threads), signal an event. With only one event to wait for, you can use WaitForSingleObject…
So no more 64-thread (MAXIMUM_WAIT_OBJECTS) limits for pools…
Source: Delphi and stuff: The strange limitation of 64 threads
–jeroen
Filed under: .NET, Delphi, Development, Power User, Software Development, Windows
