多核CPU单线程行为,未达到100% [英] Multi core CPU single thread behaviour, not achieving 100%

查看:152
本文介绍了多核CPU单线程行为,未达到100%的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从所附图像中可以看到,我的双核计算机上的CPU图形是奇特对称的!

As you can see from the attached image the CPU graph on my dual core machine is weirdly symmetrical!

这是否是某种负载平衡,以防止一个内核比另一个内核使用更多?造成这种情况的原因是什么(也许是热分布)?

Is this some sort of load balancing to prevent one core being used more than the other? What are the reasons behind it (heat distribution maybe)?

当然,我主要关心的是:我的单线程PSNR图像算法是否达到100%?

Of course my main concern: is my single thread PSNR image algorithm achieving 100%?

CPU是运行Ubuntu 10.4的Core 2 Duo E6850 3Ghz.

CPU is Core 2 Duo E6850 3Ghz running Ubuntu 10.4.

谢谢

罗斯

推荐答案

使用两个CPU都将达到50%的负载.您的程序未连接到固定的CPU,因此会根据内核(和系统上运行的其他进程)进行切换.

You are achieving a 50% load using both CPUs. Your program is not attached to a fixed CPU so it's switching, depending on the kernel (and other processes running on your system).

如果您要确保进程在内核之一上运行,则必须设置关联性(

If you want to be sure your process is running on one of your cores, you have to set affinity (Example here). This way, you should see a 100% load on one core, the other one being used for other tasks.

这篇关于多核CPU单线程行为,未达到100%的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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