Wednesday, 30 July 2008

A Concurrent Programming Primer on Code Project


I found a good read on PLINQ (Parallel LINQ) and TPL (Task Parallel Library) on code project. It doesn’t cover everything though but gives you good examples and common pitfalls using them.

The examples cover,

  • Parallel Class - Parallel.For, Parallel.Do, AsParallel  constructs
  • Exception Handling for Parallel programming constructs
  • Handling of compiler side-effects.

You need the TPL CTP download and of course VS 2008 for trying out the samples.

Converting a LINQ query from sequential to parallel execution is as simple and straightforward as below :

   1: Enumerable<T> data = ...;

   2: var q = from x in data.AsParallel() where p(x) orderby k(x) select f(x);

Here’s the link

No comments:

Post a Comment