Chapter 6. PLINQ: Declarative Data Parallelism


  • Transforming LINQ into parallelized LINQ

  • Understanding partitioning in PLINQ

  • Performing reduction operations with PLINQ

  • Creating custom PLINQ aggregate functions

  • Working with concurrent PLINQ tasks

  • Cancelling PLINQ and measuring its scalability

  • Specifying the desired degree of parallelism

  • Working with ForAll and understanding how it differs from foreach

  • Configuring how PLINQ results are returned by using WithMergeOptions

  • Handling exceptions thrown by PLINQ

  • Using PLINQ to execute Map Reduce algorithms

This chapter explains how to work with declarative data parallelism and a mix of task and data decomposition using Parallel Language Integrated Query (PLINQ). It is very important to understand all the things explained in the previous chapters before reading this one, because this chapter combines many of the topics studied before.

This chapter explains how to transform a LINQ query into a PLINQ query and the different techniques to tune its parallel execution according to different scenarios. In addition, it explains the execution of the classic parallel Map Reduce algorithms using PLINQ and its aggregate functions. Sometimes, PLINQ doesn't offer the results that developers expected. Therefore, it is also important to understand the potential performance bottlenecks and the different ways to solve them.


You already know that Language Integrated Query (LINQ) is very useful to query and process different ...

Get Professional Parallel Programming with C#: Master Parallel Extensions With .NET 4 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.