title: Configuring thread pool to reduce context switching
body: <p>I'm reading Ignite documentation and now I'm at <a href="https://apacheignite.readme.io/v1.9/docs/performance-tips#section-configure-thread-pools" rel="nofollow noreferrer"><strong><em>the section about performance</em></strong></a>. Here is what it's written (emphasized mine):</p>
  
  <blockquote>
    <p>By default, Ignite has it's main thread pool size set to 2 times the
    available CPU count. In most cases, <strong>keeping 2 threads per core will</strong>
    <strong>result in faster application performance, since there will be less</strong>
    <strong>context switching</strong> and CPU caches will work better.</p>
  </blockquote>
  
  <p>I don't understand why is it less context switching if we have 2 threads per core? I thought if all threads are busy with some job there will be pretty much of context-switch because we cannot run jobs twice as the number of cores. Which will hurt performance.</p>
  
  <p>What did they mean by that?</p>