MSDN将ConcurrentExclusiveSchedulerPair
maxItemsPerTask
定义为
maxItemsPerTask
类型:System.Int32
为该对使用的每个基础计划任务处理的最大任务数。https://msdn.microsoft.com/en-us/library/hh194750(v=vs.110).aspx
但我不明白这个定义。
如果我设置了这个(例如5
)会发生什么?
答案 0 :(得分:4)
ConcurrentExclusiveSchedulerPair
将允许creation of up to maxConcurrencyLevel
concurrent tasks(或单个独占的)处理最多maxItemsPerTask
个任务然后完成,或者作为参考来源解释它:
/// <summary>The maximum number of tasks we can process before recycling our runner tasks.</summary>
private readonly int m_maxItemsPerTask;
处理并发任务can be stopped before reaching maxItemsPerTask
if there's an exclusive task waiting to be processed的任务,但不是相反,maxItemsPerTask
可以用来限制独占任务以防止并发任务的饥饿。