在Windows 7上使用start / AFFINITY命令设置关联性 [英] Set affinity with start /AFFINITY command on Windows 7

查看:3114
本文介绍了在Windows 7上使用start / AFFINITY命令设置关联性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 start / AFFINITY [n] [.exe] 命令以指定的关联性启动可执行文件。我有一个带有8个处理器(1,2,3,4,5,6,7,8)的系统。我想将进程设置为使用所有奇数处理器(1,3,5,7)。我不知道如何做到这一点,并想知道是否可以使用start命令。如果没有,是否有一个替代的命令行方法?



start命令的帮助不是特别有用: / p>

  AFFINITY指定处理器关联掩码为十六进制数。 
进程被限制为在这些处理器上运行。

当/ AFFINITY和
/ NODE组合时,亲和力掩码被不同地解释。指定亲和度掩码,就好像NUMA
节点的处理器掩码右移为从位0开始。
该进程被限制为在指定的关联掩码和NUMA节点之间的
中的那些处理器上运行。
如果没有公用的处理器,则该过程被限制为在指定的NUMA节点上运行的
。 AFFINITY可以使用十六进制掩码,应该允许对所有处理器进行粒度控制。请注意,最右侧位指定最低阶CPU(0)(请参阅 KB 299641 )。



对于这种情况,0xAA(10101010)请求您的进程使用处理器1,3,5和7运行,但不能是0,2,4或6.请务必在命令行中省略0x。

 亲爱的AA app.exe 

其他示例:

  start / affinity 1 app.exe(仅使用CPU 0)
start / affinity 2 app.exe(仅使用CPU 1)
start / affinity 1F应用程序.exe(仅使用CPU 0,1,2,3和4)


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 like to set the process to use all of the odd processors (1,3,5,7). I cannot figure out how to do this and would like to know if it's possible using the start command. If not, is there an alternate command-line way of doing it?

The help for the start command wasn't particularly useful:

 AFFINITY    Specifies the processor affinity mask as a hexadecimal number.
             The process is restricted to running on these processors.

             The affinity mask is interpreted differently when /AFFINITY and
             /NODE are combined.  Specify the affinity mask as if the NUMA
             node's processor mask is right shifted to begin at bit zero.
             The process is restricted to running on those processors in
             common between the specified affinity mask and the NUMA node.
             If no processors are in common, the process is restricted to
             running on the specified NUMA node.

解决方案

AFFINITY works with a hexidecimal mask that should allow granular control of all of your processors. Note that the rightmost bit specifies the lowest-order CPU (0) (see KB 299641).

For the case in question, 0xAA (10101010) requests that your process run using processors 1, 3, 5 and 7, but not 0, 2, 4 or 6. Be sure to leave out the '0x' on the command line.

 start /affinity AA app.exe

Other examples:

 start /affinity 1 app.exe     (only use CPU 0)
 start /affinity 2 app.exe     (only use CPU 1)
 start /affinity 1F app.exe    (only use CPUs 0, 1, 2, 3, and 4)

这篇关于在Windows 7上使用start / AFFINITY命令设置关联性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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