I have used taskset for this. If you have taskset installed, something like: taskset -cp 0,2 45678 would set the process with id 45678 to have an affinity to cpus 1 and 3.