Executor Management (executor)

Defines settings for the Liberty kernel default executor. Note that there is always one and exactly one default executor, for use by the Liberty runtime only and not directly accessible by applications. Applications that need to configure and utilize executors should instead use Managed Executors.

NameTypeDefaultDescription

coreThreads

int

-1

Steady-state or core number of threads to associate with the executor. The number of threads associated with the executor will quickly grow to this number. If this value is less than 0, a default value is used. This default value is calculated based on the number of hardware threads on the system.

keepAlive

A period of time with millisecond precision

60s

Amount of time to keep an idle thread in the pool before allowing it to terminate. Specify a positive integer followed by a unit of time, which can be hours (h), minutes (m), seconds (s), or milliseconds (ms). For example, specify 500 milliseconds as 500ms. You can include multiple values in a single entry. For example, 1s500ms is equivalent to 1.5 seconds.

maxThreads

int

-1

Maximum number of threads that can be associated with the executor. If greater than 0, this value must be greater than or equal to the value of coreThreads. If the value of maxThreads is less than or equal to 0, the maximum number of threads is unbounded. Note that the actual number of threads associated with the executor is determined dynamically by the Liberty kernel, so leaving the maximum threads unbounded does not imply that the runtime will actively create large amounts of threads; it simply lets the Liberty kernel decide how many threads to associate with the executor without having a defined upper boundary.

name

string

Default Executor

The name of the Liberty kernel default executor.

rejectedWorkPolicy

  • ABORT

  • CALLER_RUNS

ABORT

Policy to employ when the executor is unable to stage work for execution.
ABORT
Raise an exception.
CALLER_RUNS
Execute the work immediately on the caller's thread.

stealPolicy

  • LOCAL

  • NEVER

  • STRICT

LOCAL

The work-stealing policy to employ. The options for this policy determine how work is queued, and how threads obtain queued work.
LOCAL
A global work queue is used for work that is generated by threads that are not associated with the executor. Work generated by threads associated with the executor is placed on a local work pile. This work pile is owned by the generating thread, unless another thread steals it. Threads that are associated with the executor take work associated with other threads if the local work pile is empty and there is no work on the global work queue.
NEVER
A global work queue is used to feed work to threads that are associated with the executor. No stealing will occur.
STRICT
All threads that generate work own a local work pile. Threads that are associated with the executor take work from other threads when the local work pile is exhausted.