C# Class System.Threading.Tasks.Schedulers.LimitedConcurrencyLevelTaskScheduler

Provides a task scheduler that ensures a maximum concurrency level while running on top of the ThreadPool. This is a sample from MSDN - http://msdn.microsoft.com/ru-ru/library/ee789351.aspx
Inheritance: TaskScheduler
Afficher le fichier Open project: mkjeff/secs4net Class Usage Examples

Méthodes publiques

Méthode Description
LimitedConcurrencyLevelTaskScheduler ( int maxDegreeOfParallelism ) : System.Collections.Generic

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

Méthodes protégées

Méthode Description
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.

Private Methods

Méthode Description
NotifyThreadPoolOfPendingWork ( ) : void

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

Method Details

GetScheduledTasks() protected final méthode

Gets an enumerable of the tasks currently scheduled on this scheduler.
protected final GetScheduledTasks ( ) : IEnumerable
Résultat IEnumerable

LimitedConcurrencyLevelTaskScheduler() public méthode

Initializes an instance of the LimitedConcurrencyLevelTaskScheduler class with the specified degree of parallelism.
public LimitedConcurrencyLevelTaskScheduler ( int maxDegreeOfParallelism ) : System.Collections.Generic
maxDegreeOfParallelism int The maximum degree of parallelism provided by this scheduler.
Résultat System.Collections.Generic

QueueTask() protected final méthode

Queues a task to the scheduler.
protected final QueueTask ( Task task ) : void
task Task The task to be queued.
Résultat void

TryDequeue() protected final méthode

Attempts to remove a previously scheduled task from the scheduler.
protected final TryDequeue ( Task task ) : bool
task Task The task to be removed.
Résultat bool

TryExecuteTaskInline() protected final méthode

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
Résultat bool