Questions about the ThreadPool
I have a few questions about the ThreadPool
. Primarily开发者_如何学JAVA, If I wanted to limit the number of threads in execution asynchronously, what would I change? Secondly, in set maximum and set minimum number of threads, what are the completion port threads?
Don't mess with the ThreadPool
(i.e. limiting threads) - it isn't yours to mess with, and core parts of the system will want it. You risk starvation and deadlock.
Either use a custom thread-pool implementation, or use the inbuilt options in the TPL to run an operation on a constrained number of threads.
精彩评论