How to set one task’s CPU affinity quickly?

How to set one task’s CPU affinity quickly?

1, Get this task’s ID

# taskset -pc PID

2, Set this task’s CPU affinity

# taskset -c affinity ./task

There is also another format

# taskset -pc affinity pid

For example: set process with PID 3783 to CPU 15

# taskset -pc 15 3783
Leave a Reply

Your email address will not be published. Required fields are marked *