2012-05-31 3 views
2

Linux에는 특정 프로세스에 대한 CPU 선호도를 설정할 수있는 taskset 유틸리티가 있습니다.작업 세트가 동일합니다.

Windows 환경에 해당하는 항목이 있습니까?
내 제품에 대해 최대 CPU 임계 값을 설정하고 싶습니다. Windows에이 기능을 제공하는 기존 메커니즘이 있습니까?

Starts a separate window to run a specified program or command. 

START ["title"] [/D path] [/I] [/MIN] [/MAX] [/SEPARATE | /SHARED] 
    [/LOW | /NORMAL | /HIGH | /REALTIME | /ABOVENORMAL | /BELOWNORMAL] 
    [/NODE <NUMA node>] [/AFFINITY <hex affinity mask>] [/WAIT] [/B] 
    [command/program] [parameters] 

특히 옵션 /AFFINITY <hex affinity mask> :

은 도움이, 내 제품은 닷넷

감사

+1

[선호도 체인저 (HTTP//sourceforge.net/projects/affinitychanger/) 수동으로 작업하려면 [ProcessMonitor] (http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx)를 두 가지 예제로 사용하십시오. "선호도"와 "임계 값"은 실제로 같지 않습니다. 일반적으로 프로그램이 할 일이있을 때 100 % CPU를 소비하고 아무 것도하지 않을 때 0 %를 소비하는 것을 차단하는 것이 좋습니다. – Damon

답변

3

예,이 개발된다.

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. 

CPU 0에만 바인딩하려면 선호도 마스크 0x1을 지정하십시오. CPU 1에 바인딩하려면 마스크는 0x2이어야합니다. CPU 0 및 CPU 1에 바인딩하려면 마스크는 0x3이어야합니다.

당신 또한 System.Diagnostics.Process.GetCurrentProcess()을 호출하여 얻어지는 현재 프로세스 인스턴스의 ProcessorAffinity 속성 동일한 진수 마스크 값을 할당하여 코드의 CPU 선호도를 설정할 수

using System.Diagnostics; 

Process.GetCurrentProcess().ProcessorAffinity = (IntPtr)0x3; 
관련 문제