TTaskExecutionThreadPool

A pool of TTaskExecutionThread instances that can execute a TScheduledTask.

Inheritance

LevelAncestorDescription
1TObjectUltimate ancestor in a class hierarchy
2TTaskExecutionThreadPool

Source

Task.Execution.Thread.Pool.pas (30)

Description

A pool is initialized without any threads. Whenenever a task is executed and the current number of threads is lower than the lower bound, a new thread will be added to the pool. A newly arriving task will be added to a queue and tasks in the queue will be removed by the threads in the pool that are idle. Whenever all threads are busy and new task is queued a new thread will be added to the pool. No more threads than the maximum specified will be created.

Fields

ScopeVisibilityTypeNameDescription
InstanceprivateTWaitableQueue<TEvent>FStatusQueue
InstanceprivateTWaitableQueue<TScheduledTask>Queue
InstanceprivateTInteger32IntervalConcurrencyRange
InstanceprivateTList<TTaskExecutionThread>Threads

Methods

ScopeVisibilityResultNameDescription
InstanceprivateSetStatusQueue(Value: TWaitableQueue<TEvent>)
InstanceprivateTTaskExecutionThreadCreateThread()
InstancepublicCreate(ConcurrencyRange: TInteger32Interval; MaximumQueueSize: TInteger32)
InstancepublicDestroy()
InstancepublicExecute(Task: TScheduledTask)