Introducing PLINQ
Parallel LINQ, also known as PLINQ, is a new LINQ implementation provided by .NET Framework 4.0 that enables developers to query data using the LINQ syntax but takes advantage of multicore and multiprocessor architectures that have support by the Task Parallel Library (discussed in Chapter 45). Creating “parallel” queries is an easy task, although there are some architectural differences with classic LINQ (or more generally with classic programming) that is discussed during this chapter. Basically to create a parallel query you just need to invoke the AsParallel extension method onto the data source you are querying. The following code provides an example:
Generally you can take advantage of Parallel LINQ and the Task Parallel ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access