Results 1 to 1 of 1
Thread: Thread Affinity using NPTL
Enjoy an ad free experience by logging in. Not a member yet? Register.
- Join Date
- Apr 2005
Thread Affinity using NPTL
What I am trying to do is assign a thread to a CPU using the pthread_attr_setaffinity call. A sample code was written that allowed me to assign up to 4 threads onto whatever CPU. Half the time it seems to work through monitoring top and the other time the loads goes to another CPU. For example, request CPU 0 & 1-- I get 0 & 2, request CPU 0 & 1 & 2 & 3-- I get 0 & 1 & 2 & 3, etc...
Does anybody have additional information on pthread_attr_setaffinity? It's not in the info pages. To me it seems to not fully work. Also does any body know of a tool to monitor thread to CPU, i.e. like top?