On Linux, there is the sched_setaffinity () function defined in sched.h , but I cannot find anything like it on Mac OS X 10.6 pthreads . If it is not possible to establish affinity, what is the default policy in OS X ?
Mac OS X has an Affinity Affinity API , and you can use it with a pthread identifier like thread_policy_set (pthread_mach_thread_np (pthreadId), but as far as possible as I know there are no APIs like sched_setaffinity.