C# Класс AdvUtils.LimitedConcurrencyLevelTaskScheduler

Provides a task scheduler that ensures a maximum concurrency level while running on top of the ThreadPool.
Наследование: System.Threading.Tasks.TaskScheduler
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
LimitedConcurrencyLevelTaskScheduler ( int maxDegreeOfParallelism ) : System

Initializes an instance of the LimitedConcurrencyLevelTaskScheduler class with the specified degree of parallelism.

Защищенные методы

Метод Описание
GetScheduledTasks ( ) : IEnumerable

Gets an enumerable of the tasks currently scheduled on this scheduler.

QueueTask ( Task task ) : void

Queues a task to the scheduler.

TryDequeue ( Task task ) : bool

Attempts to remove a previously scheduled task from the scheduler.

TryExecuteTaskInline ( Task task, bool taskWasPreviouslyQueued ) : bool

Attempts to execute the specified task on the current thread.

Приватные методы

Метод Описание
NotifyThreadPoolOfPendingWork ( ) : void

Informs the ThreadPool that there's work to be executed for this scheduler.

Описание методов

GetScheduledTasks() защищенный закрытый Метод

Gets an enumerable of the tasks currently scheduled on this scheduler.
protected final GetScheduledTasks ( ) : IEnumerable
Результат IEnumerable

LimitedConcurrencyLevelTaskScheduler() публичный Метод

Initializes an instance of the LimitedConcurrencyLevelTaskScheduler class with the specified degree of parallelism.
public LimitedConcurrencyLevelTaskScheduler ( int maxDegreeOfParallelism ) : System
maxDegreeOfParallelism int The maximum degree of parallelism provided by this scheduler.
Результат System

QueueTask() защищенный закрытый Метод

Queues a task to the scheduler.
protected final QueueTask ( Task task ) : void
task Task The task to be queued.
Результат void

TryDequeue() защищенный закрытый Метод

Attempts to remove a previously scheduled task from the scheduler.
protected final TryDequeue ( Task task ) : bool
task Task The task to be removed.
Результат bool

TryExecuteTaskInline() защищенный закрытый Метод

Attempts to execute the specified task on the current thread.
protected final TryExecuteTaskInline ( Task task, bool taskWasPreviouslyQueued ) : bool
task Task The task to be executed.
taskWasPreviouslyQueued bool
Результат bool