大佬教程收集整理的这篇文章主要介绍了多核处理器中的线程,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
Processor affinity is a modification of the native central queue scheduling algorithm in a symmetric multiprocessing operating system. Each task (be it process or thread) in the queue has a tag inDicaTing its preferred / kin processor. At alLOCATIOn time,each task is allocated to its kin processor in preference to others.
查看this thread,其中讨论了为特定线程设置亲和性的用法.
摘自此主题:
int sched_setaffinity(pid_t pid,size_t cpusetsize,cpu_set_t *mask); Passing 0 as the pid,and it'll apply to the current thread only,or have other thread report their kernel pid with the linux specific call pid_t gettid(void); and pass that in as the pid.
以上是大佬教程为你收集整理的多核处理器中的线程全部内容,希望文章能够帮你解决多核处理器中的线程所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。