Previous Topic

Next Topic

Book Contents

Book Index

Thread Pool

The Thread Pool Manager's operation can be configured through the following system properties:

System Property

Default Value

Description

mbs.util.threadpool.inactiveTime

30

The time period in seconds over which to perform auto-shrinking.

mbs.util.threadpool.minThreads

1

Indicates the minimum number of idle threads.

mbs.util.threadpool.maxThreads

48

Specifies the upper limit for the number of threads in the thread pool. The real limit is calculated using the formula: ((int)(max/min)) * min).

mbs.util.threadpool.autoMaximum

false

When this property is set to true, if there are more than 10 waiting jobs the maximum number of threads in the thread pool can be exceeded.

mbs.util.threadpool.ignoreMaximum

false

When true, the Thread Pool Manager will not regard the maxThread property and will always create new threads when there are no available.

mbs.util.threadpool.useNames

true

When true, allows assigning names to threads, executing runnable jobs.

mbs.util.threadpool.percent

30

Specifies what default percent of the maximum number of threads a bundle can occupy from the thread pool.

mbs.util.threadpool.pollPeriod

30000

Sets the polling interval for each executing thread pool manager job in ms. It is disabled if the value is non positive.

Thread pool manager periodically polls each running job and logs a message that job is taking too much time. When job finishes, polling is removed.

If minThreads is set to 0, then the Thread Pool Manager service will not act as a thread pooling service. When a job comes for execution, it simply creates a thread, passes the job to it, and starts the thread. The manager does not keep a fixed number of threads, or return the threads finished their job back in the pool. This feature is added to avoid duplication of the thread pooling functionality in case it is supported by the current JVM.

The framework administrator should precisely estimate the number of threads that are necessary to bundles using the Thread Pool Manager service.