I have 4 threads, and I am trying to set thread 1 to run on CPU 1, thread 2 on CPU 2, etc.
However, when I run my code below, the affinity masks are returning the correct va
I think the easiest would be to give the CPU mask as a parameter to each thread and have the thread request given affinity itself, as in example here: pthread_setaffinity_np(3).