Thread Pool

The thread pool is a queue of threads available to run a collection of tasks. Thread pools are used to improve performance when executing large numbers of asynchronous tasks by reducing per task invocation overhead. This provides a means of bounding and managing the resources consumed when executing a collection of tasks.

General

The General section has the following fields.

Field Description
Name The name to be displayed as the label for the resource.
Description A short description of the resource.

Thread Pool

This section has the following fields.

Field Literal Value/Module Property Description
Core Pool Size Yes Must be greater than or equal to zero. The default is 5.
Max Pool Size Yes The maximum number of threads in the pool. Must be greater than zero and greater than or equal to core pool size.

The default is 10.

Keep Alive Time (s) Yes The length of time an idle thread remains in the pool before being reclaimed, if the number of threads in pool is more than core pool size.

The default is 30 seconds.

Autostart Core Threads Yes Indicates to create and start the core pool size threads when the thread pool is created. Normally core threads are created and started only when new tasks arrive.
Thread Pool Name Prefix Yes A string prefixed to the name of each thread.
Daemon Yes Select the check box to specify whether the threads can be started as a daemon or a user. The default is false.
Priority Yes The default priority of the threads in the pool. The default is 5.
Rejection Policy No The policy applied when no thread is available to run a task:
  • BLOCKING: the task is blocked until a thread from the thread pool picks up this task.
  • CALLER RUNS: the task is run in the calling thread.
  • ABORT: the task is aborted and an exception is generated.

The default is BLOCKING.