I wish to pin a process to a CPU1 in my dual CPU machine - how can I do it in Linux - any pointers ?
feedback
|
migrated from stackoverflow.com Mar 25 '11 at 8:16
This question came from our site for professional and enthusiast programmers.
|
You should think long and hard about why you think you're smarter than the scheduler. After that, if you still want to set the cpu affinity of a process on linux you can use the taskset command or, if you're writing the program yourself, the sched_setaffinity system call. | |||
|
feedback
|
|
Fwiw: we did this, pinning every process in an averagely complex application that we well mastered. We found out that the linux kernel scheduler is better than us at allowing processors and processing time, as others stated above ... | |||
|
feedback
|