In Linux有一个sched_setaffinity()函数定义在sched.h,但我似乎找不到类似的东西Mac OS X 10.6 pthreads实现...如果无法设置亲和力,则默认策略是什么OS X?
Mac OS X 有线程亲和性API https://developer.apple.com/library/mac/releasenotes/Performance/RN-AffinityAPI/index.html你可以将它与 pthread ID 作为 thread_policy_set(pthread_mach_thread_np(pthreadId) 一起使用,但是,据我所知,没有像 sched_setaffinity 这样的 API。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)