I\'m working with a java.util.concurrent.ThreadPoolExecutor to process a number of items in parallel. Although the threading itself works fine, at times we\'ve
java.util.concurrent.ThreadPoolExecutor
I read the documentation of setMaximumPoolSize() and setCorePoolSize(), and it seems like they can produce the behavior you need.
-- EDIT --
My conclusion was wrong: please see the discussion below for details...