Gets or sets the processors on which the threads in this process can be scheduled to run.
Assembly: System (in System.dll)
Property ValueType: System.IntPtr
A bitmask representing the processors that the threads in the associated process can run on. The default depends on the number of processors on the computer. The default value is 2 n -1, where n is the number of processors.
information could not be set or retrieved from the associated process resource.
The process identifier or process handle is zero. (The process has not been started.)
You are attempting to access the property for a process that is running on a remote computer. This property is available only for processes that are running on the local computer.
The process Id was not available.
The process has exited.
In Windows 2000 and later, a thread in a process can migrate from processor to processor, with each migration reloading the processor cache. Under heavy system loads, specifying which processor should run a specific thread can improve performance by reducing the number of times the processor cache is reloaded. The association between a processor and a thread is called the processor affinity.
Each processor is represented as a bit. Bit 0 is processor one, bit 1 is processor two, and so forth. If you set a bit to the value 1, the corresponding processor is selected for thread assignment. When you set the value to zero, the operating system's scheduling algorithms set the thread's affinity. When the value is set to any nonzero value, the value is interpreted as a bitmask that specifies those processors eligible for selection.
The following table shows a selection of values for an eight-processor system.
1 and 2
1, 2 and 3
1 and 4
1, 2, 3, 4, 5, 6 and 7
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.