How to set one task's CPU affinity quickly?

How to set one task's CPU affinity quickly?

asked Sep 7 by harryxiyou (4,690 points)

1 Answer

 
Best answer

1, Get this task's ID

# taskset -pc PID

2, Set this task's CPU affinity

# taskset -c affinity ./task
answered Sep 7 by harryxiyou (4,690 points)

There is also another format

# taskset -pc affinity pid

For example: set process with PID 3783 to CPU 15

# taskset -pc 15 3783
commented Sep 11 by harryxiyou (4,690 points)

Please log in or register to answer this question.

Copyright © SysTutorials. User contributions licensed under cc-wiki with attribution required.
Hosted on Dreamhost

...