在PLINQ,是.AsSequential()和.AsOrdered()之间的区别? [英] In PLINQ, what is the difference between .AsSequential() and .AsOrdered()?

查看:469
本文介绍了在PLINQ,是.AsSequential()和.AsOrdered()之间的区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我似乎无法环绕不同的是AsSequential和AsOrdered之间有什么我的头。我已经看过了文档在MSDN上对于这些以及搜索的例子互联网,但我只是一个简单的鞋子的鞋匠,我无法确切地了解正在发生的事情。
如果可能的话,可能有人请解释一下什么时候使用AsSequential VS AsOrdered,并在必要时解释结果怎么会不同呢?

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 internet for examples, but I am just a simple shoe cobbler and I was unable to definitively understand what is going on. If possible, could someone please explain when you would use AsSequential vs AsOrdered, and if necessary explain how the results would be different?

推荐答案

AsOrdered 指示并行LINQ发动机保持有序,但仍并行地执行该查询。这有阻碍性能引擎必须谨慎地合并并行执行后的结果的影响。

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 指示并行LINQ引擎来执行查询顺序,即,不平行

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

这篇关于在PLINQ,是.AsSequential()和.AsOrdered()之间的区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆