I’m trying to use ManualResetEvent to verify if all threads in my ThreadPool have completed. But according to http://msdn.microsoft.com/en-us/library/3dasc8as(v=vs.80).aspx I need to have as many instances of my thread class as there are threads so that I can have a ManualResetEvent variable in each class and set it when the thread completes.
What if I have only one instance of the thread class and have to check if all threads executing a function of that instance have completed?
If you can know/determine the number of threads that will execute you can use a counter in that one class then set the single ManualResetEvent once the counter reaches the expected number.