I am following the examples given here. While I am able to successfully create threads, these threads have default affinity to all the processes.
How do I set affinity? Can someone please provide an example on how can I use SetThreadAffinityMask with the examples given on above link?
Ok, I’m going to assume you want affinity. The second parameter of
SetThreadAffinityMaskis a bit mask representing on which processors the thread is allowed to run. The bits are set to 1 on the corresponding processors. For example: