.NET Framework Process and Thread affinity setting

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!

Parameters

ParameterDetails
affinityinteger that describes the set of processors on which the process is allowed to run. For example, on a 8 processor system if you want your process to be executed only on processors 3 and 4 than you choose affinity like this : 00001100 which equals 12

Remarks

The processor affinity of a thread is the set of processors it has a relationship to. In other words, those it can be scheduled to run on.

Processor affinity represents each processor as a bit. Bit 0 represents processor one, bit 1 represents processor two, and so on.



Got any .NET Framework Question?