Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 340621 - ThreadPool interface should provide setMax, setMin, getMin, getMax API
Summary: ThreadPool interface should provide setMax, setMin, getMin, getMax API
Status: RESOLVED FIXED
Alias: None
Product: Jetty
Classification: RT
Component: server (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 7.2.x   Edit
Assignee: Greg Wilkins CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-21 23:45 EDT by David Liu CLA
Modified: 2011-04-07 04:20 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Liu CLA 2011-03-21 23:45:51 EDT
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
Comment 1 Greg Wilkins CLA 2011-03-31 18:19:38 EDT
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
Comment 2 David Liu CLA 2011-04-06 04:19:49 EDT
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
Comment 3 Greg Wilkins CLA 2011-04-06 18:40:55 EDT
I've added a SizedThreadPool interface so that threadpools that have set max/min methods implement that instead of ThreadPool.
Comment 4 David Liu CLA 2011-04-07 04:20:32 EDT
Thanks a lot, Greg.

David