(原+转)Ubuntu中设置程序可用的cpu核心

转载请注明出处:

https://www.cnblogs.com/darkknightzh/p/12592445.html

参考网址:

https://unix.stackexchange.com/questions/442146/how-can-taskset-create-pid-when-the-program-is-not-running-yet

https://www.hecticgeek.com/2012/03/assign-process-cpu-ubuntu-linux/

https://blog.csdn.net/xluren/article/details/43202201

 

可以程序运行后在指定,通过pid:

也可以程序运行前直接指定:

taskset -c 0 python main.py

使用多个核心,可以

taskset -c 0,1,2,3 python main.py

关于taskset的具体说明,见参考网址。

posted on 2020-03-29 15:15  darkknightzh  阅读(1769)  评论(0编辑  收藏  举报

导航