I'm using java.util.concurrent
's Executors
class to create a fixed thread pool for running request handlers for a web server:
static ExecutorService newFixedThreadPool(int nThreads)
and the description is:
Creates a thread pool that reuses a fixed set of threads operating off a shared unbounded queue.
However, I am looking for thread pool implementation which will do the exact same thing, except with a bounded queue. Is there such an implementation? Or do I need to implement my own wrapper for the fixed thread pool?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…