taskset --cpu-list 0,1,2,3 <app>

以上代码会将你的进程<app>绑定在4个CPU上运行,分别是0,1,2,3。

其他参数包括

SYNOPSIS
       taskset [options] [mask | list ] [pid | command [arg]...]
OPTIONS
       -p, --pid
              operate on an existing PID and not launch a new task
       -c, --cpu-list
              specifiy  a  numerical  list of processors instead of a bitmask.
              The list may contain multiple items,  separated  by  comma,  and
              ranges.  For example, 0,5,7,9-11.
       -h, --help
              display usage information and exit
       -V, --version
              output version information and exit

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-25
  • 2021-10-29
  • 2021-09-22
  • 2022-01-16
  • 2021-09-07
  • 2022-12-23
猜你喜欢
  • 2022-01-23
  • 2021-12-08
  • 2021-06-05
  • 2022-12-23
  • 2021-07-04
  • 2022-12-23
相关资源
相似解决方案