You can create n ( n is number of cores assume) threads in your program and then you can set CPU affinity of each thread so that it is tied to particular CPU Core. sched_setaffinity or pthread_setaffinity_np is the one allows you to set CPU affinity.