title: Java: ExecutorService less efficient than manual Thread executions?
body: <p>I've got a multi-threaded application. When using Thread.start() to manually start threads every concurrent thread uses exactly 25% CPU (or exactly one core - this is on a quad core machine). So if I run two threads CPU usage is exactly 50%.</p>
  
  <p>When using ExecutorService to run threads however, there seems to be one "ghost" thread consuming CPU resources! One Thread uses 50% instead of 25%, two thread use 75%, etc.</p>
  
  <p>Could this be some kind of windows task manager artefact?</p>
  
  <p>Excutor service code is</p>
  
  <pre><code>ExecutorService executor = Executors.newFixedThreadPool(threadAmount);
  
  for (int i = 1; i &lt; 50; i++) {
      Runnable worker = new ActualThread(i);
      executor.execute(worker);
  }
  executor.shutdown();
  while (!executor.isTerminated()) {
  
  }
  System.out.println("Finished all threads");
  </code></pre>
  
  <p>and Thread.start() code is:</p>
  
  <pre><code>ActualThread one= new ActualThread(2,3);
  ActualThread two= new ActualThread(3,4);
  ...
  
  Thread threadOne = new Thread(one);
  Thread threadTtwo = new Thread(two);
  ...
  
  threadOne.start();
  threadTwo.start();
  ...
  </code></pre>