title: How to run different threads on different cores?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/1407786/how-to-set-cpu-affinity-of-a-particular-pthread">how to set CPU affinity of a particular pthread?</a>  </p>
  </blockquote>
  
  
  
  <p>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.</p>