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.
Start a premium edition of VS2015, and create a new C# console application with a name of your choice.
In order to debug a program with parallel code, perform the following steps:
Use the following code to populate the body of
Program.cs
. It's a pretty simple program that starts a parallelfor
loop, which, in turn, calls a method that performs meaningless calculations intended to keep the CPU busy:class Program { static void...