假如现有一个可执行文件main.so,

1.不设置CPU绑定:

./main.so

2.设置绑定到0号CPU逻辑核心:

taskset -c 0 ./bind_core

3.设置绑定到0,1号CPU逻辑核心

taskset -c 0,1 ./bind_core