Windows Affinity

1.1k Views Asked by At

When setting the Windows CPU affinity mask for Core 2, is the mask supposed to be 0x0010 or 0x0001? I have seen an example where the mask was set to 0x0010 for Core 0 but this didn't make much sense?

2

There are 2 best solutions below

5
On

0x0000 allows no CPUs to be scheduled for this process/thread at all. (it will be suspended, assuming setting the affinity doesn't fail during parameter validation, which might be different on different Windows versions)

0x0001 allows Core 0, only

0x0002 allows Core 1, only

0x0003 allows both Core 0 and Core 1.

0
On

You can taskset it as well

("taskset -cp 2 %d"% os.getpid())