Table of Contents

Class Pool

Namespace
SunamoThreading
Assembly
SunamoThreading.dll

A thread pool implementation using a list-based worker queue. Workers process actions in FIFO order and are joined on disposal.

public sealed class Pool : IDisposable
Inheritance
Pool
Implements
Inherited Members
Extension Methods

Constructors

Pool(int)

Initializes a new instance of the Pool class with the specified number of worker threads.

public Pool(int size)

Parameters

size int

The number of worker threads to create.

Methods

Dispose()

Disposes the pool by waiting for all pending tasks to complete and joining all worker threads.

public void Dispose()

QueueTask(Action)

Adds a new task to the queue for processing by a worker thread.

public void QueueTask(Action task)

Parameters

task Action

The action to be queued for execution.