title: java Executor Service
body: <p>When I create <code>ExecutorService</code>  with below code in JAVA,can someone explain how the <code>ExecutorService</code> works ? </p>
  
  <pre><code>ExecutorService executor = Executors.newFixedThreadPool(400);
  
      for (int i = 0; i &lt; 500; i++) {
          Runnable worker = new MyRunnable(10000000L + i);
          executor.execute(worker);
      }
  </code></pre>
  
  <p>I believe that there will be a single Queue of work and my for loop will add 500 <code>Runnable</code> tasks to this queue. Now the <code>ExecutorService</code> has been created with a Thread Pool of 400 threads.</p>
  
  <p>So of those 500 tasks in the queue, the 400 threads in the <code>ExecutorService</code> will execute this 400 tasks at a time, and the remaining as slots are freed up? </p>
  
  <p>Am I correct in my understanding ?</p>