phempshall / cpuminer-affinity-setter

JavaScript tool for generating CPU affinity and priority parameters for CPUMiner
https://phempshall.github.io/cpuminer-affinity-setter/
GNU General Public License v3.0
7 stars 6 forks source link

Windows real CPU affinity #2

Open BWBama85 opened 2 years ago

BWBama85 commented 2 years ago

Hi,

On windows, what cores are the actual CPU cores and not the hyperthreaded cores? Is it every other core starting with core 1?

phempshall commented 2 years ago

Hi,

It is my understanding that the physical/virtual cores are interleaved on Windows, so your theory of every other core should be correct. Please note that this tool applies a +1 to the labels for usability - they actually start on zero like an array (CPU 1 is actually CPU 0). So a 4 core hyperthreaded processor would be [0,1] [2,3] [4,5] [6,7] with the odd numbers being the hyperthreads.

However from the Microsoft Dev Blog:

"When you turn on hyperthreading, each individual physical processor acts as if it were two virtual processors. From Task Manager’s point of view, the computer has four virtual processors. The two virtual processors associated with each physical processor are completely equivalent. It’s not like one is physical and one is virtual. They are both virtual and compete equally for a share of the one physical CPU. When you set processor affinities, you set them to virtual processors." [1]

[1] https://devblogs.microsoft.com/oldnewthing/20051216-10/?p=32943

Additional reading: