开发者

How to bind a process to a particular core in freebsd/linux

开发者 https://www.devze.com 2023-02-03 12:25 出处:网络
Is there any way to bind a process / (or a thread) to a particular core in FreeBSD//Linux I googled could not find开发者_如何学Go an answer. But people must be doing it and I am surprised that the ans

Is there any way to bind a process / (or a thread) to a particular core in FreeBSD//Linux I googled could not find开发者_如何学Go an answer. But people must be doing it and I am surprised that the answer is not easily available

Thanks for any inputs


From the command line you can use taskset. From within your code you can use sched_setaffinity.

$ man taskset
$ man sched_setaffinity


For FreeBSD you can also consider its following counterparties

$ man cpuset(1)

$ man cpuset(2)

There's a somehow related topic on server fault to check

0

精彩评论

暂无评论...
验证码 换一张
取 消