how to set CPU affinity of a particular pthread?
I'd like to specify the cpu-affinity of a particular pthread. All the references I've found so far deal with setting the cpu-affinity of a process (pid_t) not a thread (pthread_t). I tried some experiments passing pthread_t's around and as expected they fail. Am I trying to do something impossible? If not, can you send a pointer please? Thanks a million. This is a wrapper I've made to make my life easier. Its effect is that the calling thread gets "stuck" to the core with id core_id : // core_id = 0, 1, ... n-1, where n is the system's number of cores int stick_this_thread_to_core(int core_id)