Skip to content

PowerPoolOption

ZjzMisaka edited this page Feb 9, 2026 · 20 revisions

Properties

The maximum number of threads that the thread pool can support.

int MaxThreads;

The option for destroying threads in the thread pool.

DestroyThreadOption DestroyThreadOption;

The total maximum amount of time that all works in the thread pool are permitted to run collectively before they are terminated.

TimeoutOption TimeoutOption;

The default maximum amount of time a work in the pool is allowed to run before it is terminated.

TimeoutOption DefaultWorkTimeoutOption;

After setting, it will be triggered regularly when the pool is in the running state.

RunningTimerOption RunningTimerOption;

The default callback function that is called when a work finishes execution.

Action<ExecuteResult<object>> DefaultCallback;

Indicates whether the pool should begin in a suspended state.

bool StartSuspended;

FIFO, LIFO or Deque.

QueueType QueueType;

Determines whether to clear the result storage when the pool starts.

bool ClearResultStorageWhenPoolStart;

Determines whether to clear the records of failed work when the pool starts.

bool ClearFailedWorkRecordWhenPoolStart;

A factory function that creates instances of IStealablePriorityCollection<T> of type WorkItemBase.

Func<IStealablePriorityCollection<WorkItemBase>> CustomQueueFactory;

The type of work ID to be used.

WorkIDType WorkIDType;

Reject policy.

RejectOption RejectOption;

If true, the thread pool will only steal one work at a time.

bool StealOneWorkOnly;

Indicates whether collection of usage metrics is enabled, including counts and durations.

bool EnableStatisticsCollection;

Enums

enum QueueType { FIFO, LIFO, Deque };
enum WorkIDType { LongIncrement, Guid };

Clone this wiki locally