EnumerablePartitionerOptions 列舉


指定控制 partitioner 緩衝行為的選項。Specifies options to control the buffering behavior of a partitioner.

此列舉有 FlagsAttribute 屬性,因此其成員值可進行位元組合。

public enum class EnumerablePartitionerOptions
public enum EnumerablePartitionerOptions
public enum EnumerablePartitionerOptions
type EnumerablePartitionerOptions = 
type EnumerablePartitionerOptions = 
Public Enum EnumerablePartitionerOptions


NoBuffering 1

建立 Partitioner,這會從來源可列舉項目中一次取得一個項目,而不使用可透過多個執行緒更有效率進行存取的中繼儲存區。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.


這些現成的 Partitioner 是以一組預設行為所建立。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.CreateThese behaviors can be overridden by this enumeration by using the Partitioner.Create method.