Hi,
I have an interesting problem.
I am using ThreadPool.QueueUserWorkItem to fire off a number of async threads.
What I want to do is set a ceiling of threads to run, say for example 3.
As each thread complets - I need to keep a counter of the threads completed, and using the WaitHandle.WaitAny method fire off a new thread immedialty.
I am getting troublesome results, any help or code samples would be appriciated.
I have seen the threadpool.setmaxthreads but want to acheive the same thing manually.
Thanks
Tim.
I have an interesting problem.
I am using ThreadPool.QueueUserWorkItem to fire off a number of async threads.
What I want to do is set a ceiling of threads to run, say for example 3.
As each thread complets - I need to keep a counter of the threads completed, and using the WaitHandle.WaitAny method fire off a new thread immedialty.
I am getting troublesome results, any help or code samples would be appriciated.
I have seen the threadpool.setmaxthreads but want to acheive the same thing manually.
Thanks
Tim.