ParallelExecutionMode 列舉


查詢執行模式是一種提示,可指定在平行查詢時系統應該如何處理效能取捨。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.