Set affinity with start /AFFINITY command on Windows 7

前端 未结 3 945
囚心锁ツ
囚心锁ツ 2020-11-30 05:53

I am using the start /AFFINITY [n] [.exe] command to start an executable with the specified affinity. I have a system with 8 processors (1,2,3,4,5,6,7,8). I\'d

3条回答
  •  长情又很酷
    2020-11-30 06:28

    More info for your own computation needs:

    CPU ID  CPU value (dec)
    0       001 (= 2^0)
    1       002 (= 2^1)
    2       004 (= 2^2)
    3       008 (= 2^3)
    4       016 (= 2^4)
    5       032 (= 2^5)
    6       064 (= 2^6)
    7       128 (= 2^7)
    

    Consequently:

    • Mask for CPU IDs 0, 1, 2, 3, 4, 5, 6, 7: 255 (sum of individual CPU decimal values), that is the 'FF' mask as hexadecimal
    • Mask for CPU IDs 0, 2, 4, 6 : 85 (sum of individual CPU decimal values), that is the '55' mask as hexadecimal

    Reference: search the 'These are affinity mask values for an 8-CPU system' pattern at https://msdn.microsoft.com/en-US/library/ms187104.aspx.

提交回复
热议问题