VB.NET, using myProc (0). ProcessorAffinity = New IntPtr (1)
If previously one specific CPU core was specified using ProcessorAffinity, how to assign everything (as was the default)?
VB.NET, using myProc (0). ProcessorAffinity = New IntPtr (1)
If previously one specific CPU core was specified using ProcessorAffinity, how to assign everything (as was the default)?
For example:
Dim mask As IntPtr = New IntPtr((1L << Environment.ProcessorCount) - 1) myProc(0).ProcessorAffinity = mask Source of information: Process.ProcessorAffinity Property on MSDN
The default depends on the processors on the computer. The default value is 2 n - 1, where n is the number of processors.
But it’s easier and more correct to save the value before assigning the unit, and restore it later.
Source: https://ru.stackoverflow.com/questions/614996/
All Articles