5.5. Parallel Debugging Enhancements

Writing parallel and threaded applications is hard. To help, Microsoft has added additional debugging features to the Visual Studio IDE (premium versions include additional profiling features). To demonstrate these features, we will create a new simple console application.

Create a new project called Chapter5.Debugging and enter the following code:

using System.Threading.Tasks; static void Main(string[] args) { Task task1 = Task.Factory.StartNew(() => startAnotherTask()); Task task2 = Task.Factory.StartNew(() => startAnotherTask()); Task task3 = Task.Factory.StartNew(() => doSomething()); Console.ReadKey(); } static void startAnotherTask() { Task task4 = Task.Factory.StartNew(() => doSomethingElse()); } static ...

Get Introducing .NET 4.0: with Visual Studio 2010 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.