单个CPU上有多个线程和性能 [英] Multiple threads and performance on a single CPU

查看:65
本文介绍了单个CPU上有多个线程和性能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在具有单个线程且没有超线程的CPU的计算机上使用多个线程是否对性能有好处?

Is here any performance benefit to using multiple threads on a computer with a single CPU that does not having hyperthreading?

推荐答案

就计算速度而言,不.实际上,由于管理线程的开销,事情将会放慢速度.

In terms of speed of computation, No. In fact things will slow down due to the overhead of managing the threads.

就响应能力而言,是的.例如,您可以让一个线程等待IO操作,而让另一个线程同时运行GUI.

In terms of responsiveness, yes. You can for example have one thread wait on an IO operation and have another run a GUI at the same time.

这篇关于单个CPU上有多个线程和性能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆