ParallelExecutionMode Enum


查询执行模式是一个提示,指定在对查询进行并行化时系统应如何处理性能权衡。The query execution mode is a hint that specifies how the system should handle performance trade-offs when parallelizing queries.

public enum class ParallelExecutionMode
public enum ParallelExecutionMode
type ParallelExecutionMode = 
Public Enum ParallelExecutionMode


Default 0

这是默认设置。This is the default setting. PLINQ 将检查查询的结构,仅在可能带来加速时才对查询进行并行化。PLINQ will examine the query's structure and will only parallelize the query if will likely result in speedup. 如果查询结构指示不可能获得加速,则 PLINQ 会将查询当作普通的 LINQ to Objects 查询来执行。If the query structure indicates that speedup is not likely to be obtained, then PLINQ will execute the query as an ordinary LINQ to Objects query.

ForceParallelism 1

并行化整个查询,即使要使用系统开销大的算法。Parallelize the entire query, even if that means using high-overhead algorithms. 如果认为并行执行查询将带来加速,则使用此标志,但处于默认模式的 PLINQ 将按顺序执行它。Use this flag in cases where you know that parallel execution of the query will result in speedup, but PLINQ in the Default mode would execute it as sequential.

Applies to

See also