EnumerablePartitionerOptions 枚举

定义

指定控制分区程序的缓冲行为的选项。Specifies options to control the buffering behavior of a partitioner.

此枚举有一个 FlagsAttribute 属性,允许按位组合成员值。

public enum class EnumerablePartitionerOptions
[System.Flags]
[System.Serializable]
public enum EnumerablePartitionerOptions
type EnumerablePartitionerOptions = 
Public Enum EnumerablePartitionerOptions
继承
EnumerablePartitionerOptions
属性

字段

NoBuffering 1

创建分区程序,该程序从源可枚举项中一次提取项而不使用中间存储,多个线程可以更有效地访问该存储。Create a partitioner that takes items from the source enumerable one at a time and does not use intermediate storage that can be accessed more efficiently by multiple threads. 此选项支持低延迟(一从源获得项目就对其进行处理)且部分支持项目间的依赖项(线程无法死锁等待线程自身负责处理的项目)。This option provides support for low latency (items will be processed as soon as they are available from the source) and provides partial support for dependencies between items (a thread cannot deadlock waiting for an item that the thread itself is responsible for processing).

None 0

使用默认行为,就是使用缓冲实现最佳性能。Use the default behavior, which is to use buffering to achieve optimal performance.

注解

现成可用的分区程序使用一组默认行为创建。Out-of-the-box partitioners are created with a set of default behaviors. 例如,默认情况下,某种缓冲和区块将用于在 IEnumerable<T> 实现快速并且非阻塞的常见方案中实现最佳性能。For example, by default, some form of buffering and chunking will be used to achieve optimal performance in the common scenario where an IEnumerable<T> implementation is fast and non-blocking. 这些行为可由此枚举通过使用 Partitioner.Create 方法重写。These behaviors can be overridden by this enumeration by using the Partitioner.Create method.

适用于