Simulate Thread.Join

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



In the non-pooled System.Threading.Thread class, there is a Join method that
will wait until the thread is complete. How can I easily simulate this
using the thread pool. Basically, I have an application that, given it's
druthers, would generate over 300 threads, but because of resource
limitations, 10 to 15 is a realistic maximum before thread contention
becomes an issue. I know I can control the number of worker threads in the
thread pool, but I don't know how to detect that all the threads (or for
that matter, any specific thread) is complete. I need something akin to
Thread.Join.

Thanks,
Mike.


.