B
Bill
I want to use the threadpool to perform multiple tasks at once. The problem is that I was trying to find a way to only have say X number of threads running at once instead of the using the entire thread pool. I read this in MSDN,
"..there's only one pool per process and we cannot create a new one. The purpose of this limitation is to centralize all the asynchronous programming in the same pool, so that we do not have a third-party component that creates a parallel pool that we cannot manage and whose threads are degrading our performance."
But what if say I want to use the Threadpool.QueueUserWorkItem(), and have about 500 items to queue but I only want 2 threads working on the queue at once. How do I accomplish this?
"..there's only one pool per process and we cannot create a new one. The purpose of this limitation is to centralize all the asynchronous programming in the same pool, so that we do not have a third-party component that creates a parallel pool that we cannot manage and whose threads are degrading our performance."
But what if say I want to use the Threadpool.QueueUserWorkItem(), and have about 500 items to queue but I only want 2 threads working on the queue at once. How do I accomplish this?