[英]What happens if you try to utilize TPL on a computer with a single core?
Title does justice. 标题是公正的。
I'm building an application that uses TPL instead of Backgroundworker, but I'm wondering what might happen if you try to run TPL on a machine that doesn't use multi-core cpus. 我正在构建一个使用TPL而不是Backgroundworker的应用程序,但我想知道如果你尝试在不使用多核cpu的机器上运行TPL会发生什么。
Are there any compatibility issues? 有兼容性问题吗? Performance slow-downs?
业绩放缓? Or does application go boom?
或者应用程序是否会繁荣?
A singe-core PC can still do threading. 单核PC仍然可以进行线程化。
Everything should work normally, with the ThreadPool creating a very low number of threads (1 or 2 by default). 一切都应该正常工作,ThreadPool创建的线程数量非常少(默认为1或2)。
You still pay for the overhead of TPL but you will not normally get any benefits. 您仍然需要支付TPL的开销,但通常不会获得任何好处。
No issues, no measurable slow-down. 没有问题,没有可衡量的减速。 Of course also no speed-up for CPU-bound tasks.
当然也没有加速CPU绑定任务的速度。 TPL adapts automatically to the number of available cores.
TPL自动适应可用内核的数量。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.