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

Get Visual Basic® 2010 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.