gpt4 book ai didi

.net - ConcurrentExclusiveSchedulerPair 中 maxItemsPerTask 的作用是什么?

转载 作者:行者123 更新时间:2023-12-01 00:54:14 26 4
gpt4 key购买 nike

MSDN 定义 ConcurrentExclusiveSchedulerPair maxItemsPerTask作为

maxItemsPerTask
Type: System.Int32
The maximum number of tasks to process for each underlying scheduled task used by the pair.

https://msdn.microsoft.com/en-us/library/hh194750(v=vs.110).aspx.



但我不明白这个定义。

如果我设置它(例如设置为 5 ),实际会发生什么?

最佳答案

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可用于限制独占任务以防止并发任务饿死。

关于.net - ConcurrentExclusiveSchedulerPair 中 maxItemsPerTask 的作用是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29244659/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com