Ordered PLINQ ForAll

后端 未结 6 1293
长情又很酷
长情又很酷 2021-01-04 08:09

The msdn documentation about order preservation in PLINQ states the following about ForAll().

  • Result when the source sequence is ordered
6条回答
  •  情话喂你
    2021-01-04 08:41

    Order preservation is usually only applied to results - i.e. the input can be processed in any order, but is returned in the original order.

    As ForAll doesn't return anything, it doesn't really have any effect that I'm aware of.

    The only way of making ordering apply to the processing would be to finish item 0 before processing item 1, before processing item 2 etc... at which point you've got no parallelism.

提交回复
热议问题