I am trying to bypass the the wait64 handle limit that .net 3.5 imposes
I have seen this thread : http://stackoverflow.com/questions/2702545/workaround-for-the-waithandle-waitall-64-handle-limit
So I understand the general idea but I am having difficulty because I am not using a delegate but rather
I am basically working of this example : http://msdn.microsoft.com/en-us/library/3dasc8as%28VS.80%29.aspx
This link http://www.switchonthecode.com/tutorials/csharp-tutorial-using-the-threadpool is similar but again the int variable keeping track of the tasks is a member variable.
Where in the above example would I pass the threadCount integer? Do I pass it in the callback method as an object? I think I am having trouble with the callback method and passing by reference.
Thanks Stephen,
That link is not entirely clear to me.
Let me post my code to help myself clarify:
for (int flows = 0; flows < NumFlows; flows++)
{
ResetEvents[flows] = new ManualResetEvent(false);
ICalculator calculator = new NewtonRaphson(Perturbations);
Calculators[flows] = calculator;
ThreadPool.QueueUserWorkItem(calculator.ThreadPoolCallback, flows);
}
resetEvent.WaitOne();
Where would I pass in my threadCount variable. I assume it needs to be decremented in calculator.ThreadPoolCallback?