How to: Use the Parallel Watch Window
For the latest documentation on Visual Studio 2017 RC, see Visual Studio 2017 RC Documentation.
In the Parallel Watch window, you can simultaneously display the values that one expression holds on multiple threads. Each row represents a thread that is running in an application, but a thread might be represented in multiple rows. More specifically, each row represents a function call whose function signature matches the function on the current stack frame. You can sort, reorder, remove, and group the items that are in the columns. You can flag, unflag, freeze (suspend), and thaw (resume) threads. The following columns are displayed in the Parallel Watch window:
The flag column, in which you can mark a thread that you want to pay special attention to.
The frame column, in which an arrow indicates the selected frame.
A configurable column that can display the machine, process, tile, task, and thread.
You must open the Parallel Task window to display the task information in the Parallel Watch window.
The <Add Watch> column, in which you can enter expressions to watch.
Your computer might show different names or locations for some of the Visual Studio user interface elements in the following instructions. The Visual Studio edition that you have and the settings that you use determine these elements. For more information, see Personalizing the IDE.
Set a breakpoint in the code.
On the menu bar, choose Debug, Start Debugging. Wait for the application to reach the breakpoint.
On the menu bar, choose Debug, Windows, Parallel Watch, and then choose a watch window. You can open as many as four windows.
- Select <Add Watch> and then specify a watch expression.
- Select the flag column for the row, or open the shortcut menu for the thread and choose Flag or Unflag.
- Choose the Show Flagged Only button in the upper-left corner of the Parallel Watch window.
- Double-click the frame column. (Keyboard: Select the row and press Enter.)
- Select the column heading.
- Open the shortcut menu for the Parallel Watch window, choose Group By, and then choose the appropriate submenu item.
- Open the shortcut menu for the row and choose Freeze or Thaw.
- Choose the Open in Excel button and then choose Open in Excel or Export to CSV.
- Enter a Boolean expression in the Filter by Boolean Expression box. The debugger evaluates the expression for each thread context. Only rows where the value is