Community
Participate
Working Groups
Build Identifier: 6.1.21 The current org.mortbay.thread.ThreadPool interface only have a few method which does not provide the ability to control the ThreadPool. Can we have these method in org.mortbay.thread.ThreadPool interface? * getMinThreads() * getMaxThreads() * setMinThreads(int minThreads) * setMaxThreads(int maxThreads) thanks. David Reproducible: Always
well not all threadpools have min/max. And not all thread pools allow them to be set after construction. Why do you need them on the generic interface rather than just on the specific implementation classes? Note that via JMX they are visible for management. Please reopen this issue if you have a use-case that needs these. cheers
Hi Greg, Thanks for your reply. I am using Jetty as an embedded http server, and expose some public API to change its thread pool by other user in the runtime, they may use API to change its threadpool size instead of using jmx. At this moment, I have to check if the threadpool is Bounded/Queue threadpool and then call its setmax/setmin method to control its pool size. so, If jetty uses a new ThreadPool impl, then my code won't work because it cannot understand the new pool impl, but most pool can provide min/max control. so that is the reason why I want this feature. Can jetty provide such methods? David
I've added a SizedThreadPool interface so that threadpools that have set max/min methods implement that instead of ThreadPool.
Thanks a lot, Greg. David