VS2010 Parallel Tasks Debugging - Debugging enhancement in VS2010 or 4.0

VS2010 has new concept for Parallel Programming that is added as part of .NET Framework 4.0. This makes the ability to work in multi-core processor Environment. Digging through the code and debugging in parallel programming would definitely help.
The new debugging windows added are
1. Parallel Tasks
2. Parallel Stacks. 
To access these windows, Press F5 in Visual Studio 2010 to run with debugging.  Then click on the “Debug” menu item, select “Windows” and then click “Parallel Tasks” or “Parallel Stacks”. 
parallelstacks
Parallel Tasks
The Parallel Tasks window displays debugging information about each System.Threading.Tasks. This window resembles Threads window, where we have tasks here instead of threads.
ParallelStacks - Example
It shows
Flags – To Flag or UN-Flag the tasks, (this can be done by right clicking and click on Flag or Un-Flag)
Icons - Indicates the current task and allows freezing / unfreezing the tasks.
Task ID – The Identification Number for the task.
Task status - Tells us to identify task status as scheduled, running, deadlocked or waiting).
Location – Contains information of task’s initial method with any passed-in arguments.
Task – Describes the parent task for the current task.
Thread assignment – The tread assigned for the task.
App-Domain – The tasks Application Domain.
Here is the status of the color codes
  • Orange Color indicates - Waiting
  • Red Color Indicates – Dead Lock
  • Blue Color Indicates - Scheduled
  • Green Color Indicates - Running
Customize the window
You can make any of the columns as visible or invisible and customize them. Right click on the header column and check or uncheck the check boxes to make the fields visible or invisible.
Sorting and Grouping of the tasks
You can sort the tasks ascending or descending and group tasks using this window.  Clicking on individual header columns leads to sort ascending and descending. The below figure indicates Group by Individual column(Location).
GroupByColumn
Parent – Child View Option
There is a Parent-Child view option, where child tasks are displayed as nodes under the corresponding parents.
Flag or Un-Flag Tasks
The tasks can be flagged by right-clicking on the task row and selecting “Flag”. This can be used for filtering flags that allows focusing on the flagged tasks only. 
Freezing or Un-Freeze Threads
You can freeze the thread on which a task is running by right-clicking on the task row and selecting “Freeze Assigned Thread”. This will result in termination of thread when step through code. 
ParallelTasks - Options

0 comments:

Post a Comment