Possible Duplicate:
Bind threads to processors
In Linux, is it possible to fix threads to execute on certain cores. If that is possible, I also want to know if it is possible to execute one thread exclusively on a certain core, that is disallowing any other thread to execute on that core while that thread is executing.
That’s what
pthread_setaffinity_np(3)does.As an example:
You can also do it with
sched_setaffinity(2)andgettid, but that manual page says: