We have seen how we can implement PLINQ queries and specify ordering, merging, and parallel execution options. We have also seen how to execute a PLINQ with the
ForAll() method and as a
foreach loop. All of these factor into the performance of the query. It is also important to examine how .NET decides to partition a source data collection when it decides to execute a PLINQ in parallel. Remember, a PLINQ executed in parallel is just a LINQ where a data collection is partitioned into groups and a task is created to process the
Where action of the query on each partition of data. The following diagrams depict the differences between LINQ processing and PLINQ processing.
The following diagram shows the ...