.NET Parallel Programming

All about Async/Await, System.Threading.Tasks, System.Collections.Concurrent, System.Linq, and more…

Tasks and Unhandled Exceptions

Prior to the .NET Framework 2.0, unhandled exceptions were largely ignored by the runtime.  For example, if a work item queued to the ThreadPool threw an exception that went unhandled by that work item, the ThreadPool would eat that exception and continue on its merry way.  Similarly, if a finalizer running on the finalizer thread ...

ParallelOptions.MaxDegreeOfParallelism vs PLINQ’s WithDegreeOfParallelism

We exert a good deal of effort ensuring that the APIs we provide are consistent within Parallel Extensions as well as with the rest of the .NET Framework.  This is from many angles, including behavior and general design, but also naming.  So when there are slight differences in naming, it raises questions.One occurrence of such a ...

Samples for Parallel Programming with the .NET Framework 4

Along with the release of the .NET Framework 4 Beta 1, we've just published a slew of samples that demonstrate using Parallel Extensions in a variety of ways.  You can download these from Code Gallery at https://code.msdn.microsoft.com/ParExtSamples.These samples include raytracers, a sudoku game, an image colorization algorithm, solvers ...

Concurrent, Multi-core Programming on Windows and .NET

Thanks to everyone who attended our PDC pre-conference session yesterday on parallelism and concurrency!  We had a wonderful turnout at the event, and David, Joe, and I all had a terrific time. Attached to this post are the slides we presented. (It turns out that the PDC site does allow you to submit an evaluation for a precon.  If ...

ParallelWhileNotEmpty

Parallel Extensions includes the System.Threading.Parallel class, which provides several high-level loop replacement constructs like For and ForEach. In previous blog posts, we've taken a look at implementing other loops, such as for loops with arbitrary initialization, conditional, and update logic, range-based loops, and a parallel while.&...