Here is a simple way to bind a proc to a cpu. The taskset command is part of the util-linux package.
Bind process 2225 to processor 0:
taskset -p -c 0 2225
Bind process 2225 to processor 1:
taskset -p -c 1 2225
Bind process 2225 to processor 0 and 1:
taskset -p -c 0,1 2225
You can also bind a process at execution:
taskset -c 0 sshd
Retrieving the pids current affinity:
[root@localhost ~]# taskset -p 2225
pid 2225’s current affinity mask: 3