转载请注明出处:

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的具体说明,见参考网址。

相关文章:

  • 2021-10-11
  • 2021-12-03
  • 2022-12-23
  • 2022-01-15
  • 2022-12-23
  • 2021-11-29
  • 2021-08-16
  • 2021-11-29
猜你喜欢
  • 2022-02-06
  • 2021-12-05
  • 2021-12-19
  • 2022-12-23
  • 2021-11-29
  • 2021-07-01
  • 2021-06-17
相关资源
相似解决方案