Multi core CPU single thread behaviour, not achieving 100%

前端 未结 2 1164
小鲜肉
小鲜肉 2021-01-19 16:37

\"alt

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

2条回答
  •  既然无缘
    2021-01-19 17:00

    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.

提交回复
热议问题