Is it possible to set an affinity for the pthread processor in OS X?

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 ?

+4
source share
1 answer

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.

+5
source

All Articles