title: Why is Having More Threads than Cores Faster?
body: <p>I've implemented a version of PageRank in a multithreaded version. I'm running it on a 4-core Q6600. When I run it set to create 4 threads, I get:</p>
  
  <pre><code>real    6.968s
  user   26.020s
  sys     0.050s
  </code></pre>
  
  <p>When I run with 128 threads I get:</p>
  
  <pre><code>real    0.545s
  user    1.330s
  sys     0.040s
  </code></pre>
  
  <p>This makes no sense to me. The basic algorithm is a sum-reduce: </p>
  
  <ol>
  <li>All threads sum a subset of the input;</li>
  <li>Synchronize;</li>
  <li>Each thread then accumulates part of the results from the other threads;</li>
  <li>The main thread sums an intermediate value from all the threads and then determines whether to continue.</li>
  </ol>
  
  <p>Profiling hasn't helped. I'm not sure what data would be helpful to understand my code - please just ask.</p>
  
  <p>It really has me puzzled.</p>