Debugging parallel code

With the prevalence of multicore CPUs we are seeing more and more applications taking advantage of parallel processing to improve performance. A number of features such as Task Parallel Library (TPL) and Parallel LINQ (PLINQ) were added by .NET Framework 4.0 to make developing applications that take advantage of multicore CPUs much simpler to write.

The debugging experience for threaded applications in Visual Studio has gotten better with each release, and VS2013 is no exception. Let's take a look at what is available.

Getting ready

Start a premium edition of VS2015, and create a new C# console application with a name of your choice.

How to do it…

In order to debug a program with parallel code, perform the following steps:

Get Visual Studio 2015 Cookbook - Second Edition 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.