Ответ 1
Да, есть:
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>
в частности.
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 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.
Если вы хотите привязать только к процессору 0, укажите маску слияния 0x1
. Для привязки к ЦП 1 маска должна быть 0x2
. Для привязки к ЦП 0 и ЦП 1 маске должно быть 0x3
и т.д.
Вы также можете установить сродство к процессору в коде, присвоив те же шестнадцатеричные значения маски свойству ProcessorAffinity
экземпляра текущего процесса, который можно получить, вызвав System.Diagnostics.Process.GetCurrentProcess()
:
using System.Diagnostics;
Process.GetCurrentProcess().ProcessorAffinity = (IntPtr)0x3;