title: how to make multi-threads use 100% CPU, say 4 threads kill 4 cores to 100%
body: <p>My question: how to make multi-threads use 100% CPU (at least 80%), say let 4 threads use 4 cores to 100%?</p>
  
  <p>The whole story:
  I wrote some posix multi-threads code. When run it on a multi-core (up to 16) cluster server, although the wall time decrease with using more cores, the overall computation time ( the sum of time spent on the part of code ~without~ any synchronization ). I guess it is because some cores did not dedicate to running my thread. My guess is confirmed when run the code on my laptop.</p>
  
  <p>I tried to assign affinity with pthread_setaffinity_np 
      and to set priority pthread_attr_setschedpolicy(&amp;attributes_, SCHED_FIFO);
                          pthread_attr_setschedparam(&amp;attributes_, &amp;p);</p>
  
  <p>which doesn't help.</p>