O'Reilly logo

Visual Studio 2012 Cookbook by Richard Banks

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Debugging parallel code

With the prevalence of multi-core CPU's we are seeing more and more applications taking advantage of parallel processing to improve performance.

.NET Framework 4.0 added a number of features such as Task Parallel Library (TPL) and Parallel LINQ (PLINQ) to make developing applications that take advantage of multi-core CPUs much simpler to write.

While the debugging experience for threaded applications in Visual Studio 2010 was good, it gets even better with Visual Studio 2012, and this recipe will show you how to use these improvements.

Getting ready

Start Visual Studio 2012 and create a new C# console application. For this recipe call the application ParallelDebugging.

How to do it...

  1. Use the following code to populate the body ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required