Possible Duplicate:
how to set CPU affinity of a particular pthread?
I am writing a c++ program, using g++ compiler in Ubuntu. I have 4 threads in my program and 4 cores on my CPU. I want to be sure that each thread will be run on a different core. I am rarely familiar with pthread.