title: Java ThreadPoolExecutor strategy, 'Direct Handoff' with queue?
body: <p>I'm looking to have a <code>ThreadPoolExecutor</code> where I can set a <code>corePoolSize</code> and a <code>maximumPoolSize</code> and what happens is the queue would hand off task immediately to the thread pool and thus create new threads until it reaches the <code>maximumPoolSize</code> then start adding to a queue.</p>
  
  <p>Is there such a thing? If not, are there any good reason it doesn't have such a strategy?</p>
  
  <p>What I want essentially is for tasks to be submitted for execution and when it reaches a point where it is essentially going to get 'worst' performance from having too many threads (by setting maximumPoolSize), it would stop adding new threads and work with that thread pool and start queuing, then if the queue is full it rejects.</p>
  
  <p>And when load comes back down, it can start dismantling threads that are unused back to the corePoolSize.</p>
  
  <p>This makes more sense to me in my application than the 'three general strategies' listed in <a href="http://docs.oracle.com/javase/6/docs/api/java/util/concurrent/ThreadPoolExecutor.html">http://docs.oracle.com/javase/6/docs/api/java/util/concurrent/ThreadPoolExecutor.html</a></p>