关于线程池的问题
I have a few questions about the ThreadPool
. Primarily, 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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不要搞乱
ThreadPool
(即限制线程)——它不是你可以搞乱的,系统的核心部分会需要它。你面临饥饿和僵局的风险。使用自定义线程池实现,或使用 TPL 中的内置选项在有限数量的线程上运行操作。
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.