6[DebuggerDisplay(
"Concurrent={ConcurrentTaskCountForDebugger}, Exclusive={ExclusiveTaskCountForDebugger}, Mode={ModeForDebugger}")]
41 [DebuggerDisplay(
"Count={CountForDebugger}, MaxConcurrencyLevel={m_maxConcurrencyLevel}, Id={Id}")]
380 completionState.m_completionQueued =
true;
437 for (
int i = 0; i <
count; i++)
482 m_threadProcessingMode.Value =
ProcessingMode.ProcessingExclusiveTask;
489 if (!result.IsFaulted)
497 m_threadProcessingMode.Value =
ProcessingMode.NotCurrentlyProcessing;
510 m_threadProcessingMode.Value =
ProcessingMode.ProcessingConcurrentTasks;
517 if (!result.IsFaulted)
529 m_threadProcessingMode.Value =
ProcessingMode.NotCurrentlyProcessing;
void AddRange(IEnumerable< KeyValuePair< TKey, TValue > > collection)
static int ProcessorCount
static int CompareExchange(ref int location1, int value, int comparand)
List< Exception > m_exceptions
bool m_completionRequested
IEnumerable< Task > ScheduledTasks
int MaximumConcurrencyLevel
DebugView(ConcurrentExclusiveTaskScheduler scheduler)
readonly ConcurrentExclusiveTaskScheduler m_taskScheduler
ConcurrentExclusiveSchedulerPair SchedulerPair
override IEnumerable< Task > GetScheduledTasks()
readonly ConcurrentExclusiveSchedulerPair m_pair
readonly ProcessingMode m_processingMode
ConcurrentExclusiveTaskScheduler(ConcurrentExclusiveSchedulerPair pair, int maxConcurrencyLevel, ProcessingMode processingMode)
override int MaximumConcurrencyLevel
bool TryExecuteTaskInlineOnTargetScheduler(Task task)
override void QueueTask(Task task)
void ExecuteTask(Task task)
readonly int m_maxConcurrencyLevel
override bool TryExecuteTaskInline(Task task, bool taskWasPreviouslyQueued)
readonly IProducerConsumerQueue< Task > m_tasks
IEnumerable< Task > ScheduledConcurrent
IEnumerable< Task > ScheduledExclusive
TaskScheduler TargetScheduler
DebugView(ConcurrentExclusiveSchedulerPair pair)
readonly ConcurrentExclusiveSchedulerPair m_pair
int CurrentlyExecutingTaskCount
SchedulerWorkItem(ConcurrentExclusiveSchedulerPair pair)
readonly ConcurrentExclusiveSchedulerPair _pair
void CleanupStateIfCompletingAndQuiesced()
int ConcurrentTaskCountForDebugger
void ProcessConcurrentTasks()
bool TryQueueThreadPoolWorkItem(bool fairly)
static int DefaultMaxConcurrencyLevel
TaskScheduler ExclusiveScheduler
static TaskCreationOptions GetCreationOptionsForTask(bool isReplacementReplica=false)
readonly TaskScheduler m_underlyingTaskScheduler
SchedulerWorkItem m_threadPoolWorkItem
CompletionState m_completionState
void ProcessAsyncIfNecessary(bool fairly=false)
CompletionState EnsureCompletionStateInitialized()
@ ProcessingConcurrentTasks
@ ProcessingExclusiveTask
readonly ConcurrentExclusiveTaskScheduler m_exclusiveTaskScheduler
ProcessingMode ModeForDebugger
TaskScheduler ConcurrentScheduler
readonly ThreadLocal< ProcessingMode > m_threadProcessingMode
readonly int m_maxConcurrencyLevel
ConcurrentExclusiveSchedulerPair(TaskScheduler taskScheduler)
readonly int m_maxItemsPerTask
int ExclusiveTaskCountForDebugger
ConcurrentExclusiveSchedulerPair(TaskScheduler taskScheduler, int maxConcurrencyLevel)
void FaultWithTask(Task faultedTask)
void ProcessExclusiveTasks()
ConcurrentExclusiveSchedulerPair()
readonly ConcurrentExclusiveTaskScheduler m_concurrentTaskScheduler
ConcurrentExclusiveSchedulerPair(TaskScheduler taskScheduler, int maxConcurrencyLevel, int maxItemsPerTask)
static TaskScheduler Default
bool TryExecuteTask(Task task)
static Task FromException(Exception exception)
static bool QueueUserWorkItem(WaitCallback callBack)
static void UnsafeQueueUserWorkItemInternal(object callBack, bool preferLocal)
static Thread CurrentThread
static bool Read(ref bool location)