O'Reilly logo

C# Multithreaded and Parallel Programming by Rodney Ringler

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Understanding performance improvements in PLINQ

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required