ProcessThread::IdealProcessor Property
Sets the preferred processor for this thread to run on.
Assembly: System (in System.dll)
Property Value
Type: System::Int32The preferred processor for the thread, used when the system schedules threads, to determine which processor to run the thread on.
| Exception | Condition |
|---|---|
| Win32Exception | The system could not set the thread to start on the specified processor. |
| PlatformNotSupportedException | The platform is Windows 98 or Windows Millennium Edition. |
| NotSupportedException | The process is on a remote computer. |
The IdealProcessor value is zero-based. In other words, to set the thread affinity for the first processor, set the property to zero.
The system schedules threads on their preferred processors whenever possible.
A process thread can migrate from processor to processor, with each migration reloading the processor cache. Specifying a processor for a thread can improve performance under heavy system loads by reducing the number of times the processor cache is reloaded.
Available since 1.1