February 2010
Beginner
400 pages
11h 13m
English
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 ...