C# 클래스 RampUp.Threading.RoundRobinThreadAffinedTaskScheduler

An implementation of TaskScheduler which creates an underlying thread pool and set processor affinity to each thread.
상속: System.Threading.Tasks.TaskScheduler, IDisposable
파일 보기 프로젝트 열기: Scooletz/RampUp

Private Properties

프로퍼티 타입 설명
CreateThreads void
RemoveThreadAffinity void
SetThreadAffinity void
ThreadStartWithAffinity void

공개 메소드들

메소드 설명
Dispose ( ) : void

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

RoundRobinThreadAffinedTaskScheduler ( int numberOfThreads ) : System

Create a new RoundRobinThreadAffinedTaskScheduler with a provided number of background threads. Threads are pined to a logical core using a round robin algorithm.

보호된 메소드들

메소드 설명
GetScheduledTasks ( ) : IEnumerable

Generates an enumerable of T:System.Threading.Tasks.Task instances currently queued to the scheduler waiting to be executed.

QueueTask ( Task task ) : void

Queues a T:System.Threading.Tasks.Task to the scheduler.

TryExecuteTaskInline ( Task task, bool taskWasPreviouslyQueued ) : bool

Determines whether the provided T:System.Threading.Tasks.Task can be executed synchronously in this call, and if it can, executes it.

비공개 메소드들

메소드 설명
CreateThreads ( int numberOfThreads, int processorIndexes ) : void
RemoveThreadAffinity ( ) : void
SetThreadAffinity ( int processorIndex ) : void
ThreadStartWithAffinity ( int threadIndex, int processorIndexes ) : void

메소드 상세

Dispose() 공개 메소드

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public Dispose ( ) : void
리턴 void

GetScheduledTasks() 보호된 메소드

Generates an enumerable of T:System.Threading.Tasks.Task instances currently queued to the scheduler waiting to be executed.
This scheduler is unable to generate a list of queued tasks at this time.
protected GetScheduledTasks ( ) : IEnumerable
리턴 IEnumerable

QueueTask() 보호된 메소드

Queues a T:System.Threading.Tasks.Task to the scheduler.
The argument is null.
protected QueueTask ( Task task ) : void
task Task The to be queued.
리턴 void

RoundRobinThreadAffinedTaskScheduler() 공개 메소드

Create a new RoundRobinThreadAffinedTaskScheduler with a provided number of background threads. Threads are pined to a logical core using a round robin algorithm.
public RoundRobinThreadAffinedTaskScheduler ( int numberOfThreads ) : System
numberOfThreads int Total number of threads in the pool.
리턴 System

TryExecuteTaskInline() 보호된 메소드

Determines whether the provided T:System.Threading.Tasks.Task can be executed synchronously in this call, and if it can, executes it.
The argument is null. The was already executed.
protected TryExecuteTaskInline ( Task task, bool taskWasPreviouslyQueued ) : bool
task Task The to be executed.
taskWasPreviouslyQueued bool A Boolean denoting whether or not task has previously been queued. If this parameter is True, then the task may have been previously queued (scheduled); if False, then the task is known not to have been queued, and this call is being made in order to execute the task inline without queuing it.
리턴 bool