In PLINQ, what is the difference between .AsSequential() and .AsOrdered()?

前端 未结 1 1402
甜味超标
甜味超标 2021-02-18 14:10

I can\'t seem to wrap my head around what the difference is between AsSequential and AsOrdered. I have looked up documentation on msdn for each of these as well as searching the

1条回答
  •  旧巷少年郎
    2021-02-18 14:34

    AsOrdered instructs the Parallel LINQ engine to preserve ordering, but still executes the query in parallel. This has the effect of hindering performance as the engine must carefully merge the results after parallel execution.

    AsSequential instructs the Parallel LINQ engine to execute the query sequentially, that is, not in parallel.

    0 讨论(0)
提交回复
热议问题