BlackWaspTM

This web site uses cookies. By using the site you accept the cookie policy.This message is for compliance with the UK ICO law.

Debugging
VS 2010+

Visual Studio 2010 Parallel Tasks Window

Debugging code that uses parallel programming techniques presents additional difficulties to debugging software that executes on a single thread. Visual Studio provides tools that assist with these problems. One such tool is the Parallel Tasks window.

Organising Tasks

There are several ways in which you can organise the information in the grid. The simplest option is to sort the task rows. You can do this by clicking a column heading to order the information by that column. Clicking again reverses the order. You can also group the task information. To do so, right-click a column header and choose the grouping option from the context-sensitive menu that appears. Finally, you can arrange tasks according to their parent and child task relationships. When child tasks are present, right-click a column heading and choose, "Parent Child View". Parent tasks will then appear above their children and the ID column will show a glyph that can be clicked to toggle the visibility of child tasks in a hierarchical view. To disable parent child view, right-click again and choose, "Flat View".

Freezing Tasks

When you have multiple tasks that share the same state data, debugging one task can be complicated by the concurrent execution of another. Sometimes, in order to examine one task cleanly, it is useful to disable the threads responsible for those other tasks. You can do this by freezing threads from the Parallel Tasks window. A frozen task remains paused when you resume the program and will only restart if you re-enable, or thaw, it.

You can freeze a single task by right-clicking its row in the grid and choosing "Freeze Assigned Thread". All tasks on the selected thread will be frozen. Alternatively, you can right-click a task that you wish to isolate and select, "Freeze All Threads But This". This allows the chosen thread to continue when you restart debugging but freezes all of the other threads shown in the grid.

When you have completed the debugging task that required threads to be frozen you can thaw the frozen threads. To do so, right-click them and select, "Thaw Assigned Thread" from the context-sensitive menu.

20 May 2012