AsParallel.ForAll vs Parallel.ForEach

前端 未结 4 1158
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-31 15:11

Is there any difference between the below code snippets. If so, what?

myList.AsParallel().ForAll(i => { /*DO SOMETHING*/ });

and

Pa

4条回答
  •  独厮守ぢ
    2021-01-31 16:17

    You have the option to order the elements with AsParallel().AsOrdered(). Ordering in Parallel.ForEach is not out of box, we need do it.

提交回复
热议问题