On Fri, 5 Nov 2004, Vadim Gritsenko wrote:

Giacomo Pati wrote:

A thread pool consists of:
- max. # of threads that run simultaneously
- a possible queue to stack up ready to run Runnables

If you have a lot of short living Runnables at low priority (logically) you'd prefere to have a thread pool with only a few threads ready but a large queue. If you have some long running jobs to be done you'd like to have a pool of many threads. Thread pools is the way to balance "work to be done" with "resources needed for".

Ok, go ahead. It just means that users of BackgroundManager (such as include transfomer) should have thread pool name configurable. Probably we could supply two thread pools, one for request processing, and one for system tasks.

I decided to have a "default thread pool" in any case (even if BackgroundManager has no configuration) named "default" (and thus can be overwritten by configuration but the BackgroundManager ensures it has the required minumum set). This pool should satisfy the "usual" work.


And still, there should be a way to configure thread pools' priority - as part of BackgroundManager configuration, I assume.

Yes, there will be.

I'll commit the first draft in an hours or two into trunk for review (just the package, nothing else changed so far). I dicided to call the package

org.apache.cocoon.components.thread

and the main interface RunnableManager (instead of BackgroundManager)

Any better names for package and interface are welcome :-)

--
Giacomo Pati
Otego AG, Switzerland - http://www.otego.com
Orixo, the XML business alliance - http://www.orixo.com

Reply via email to