Skip to content

Commit 01bc9d5

Browse files
committed
edits
1 parent 5c715a3 commit 01bc9d5

File tree

4 files changed

+40
-32
lines changed

4 files changed

+40
-32
lines changed

docs/debugger/TOC.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -124,18 +124,18 @@
124124
## [Get Started Debugging Multithreaded Applications](how-to-use-the-threads-window.md)
125125
## [Tools to Debug Threads and Processes](debug-threads-and-processes.md)
126126
## [Debug Multiple Processes](debug-multiple-processes.md)
127-
## [How to: Use the Threads Window](walkthrough-debugging-a-multithreaded-application.md)
127+
## [Walkthrough: Debugging a Parallel Application](walkthrough-debugging-a-parallel-application.md)
128128
## [How to: Switch to Another Thread While Debugging](how-to-switch-to-another-thread-while-debugging.md)
129129
## [How to: Flag and Unflag Threads](how-to-flag-and-unflag-threads.md)
130-
## [How to: Set a Thread Name in Native Code](how-to-set-a-thread-name-in-native-code.md)
131-
## [How to: Set a Thread Name in Managed Code](how-to-set-a-thread-name-in-managed-code.md)
132-
## [How to: Debug On a High-Performance Cluster](how-to-debug-on-a-high-performance-cluster.md)
133-
## [Tips for Debugging Threads in Native Code](tips-for-debugging-threads-in-native-code.md)
134-
## [Using the Tasks Window](using-the-tasks-window.md)
135-
## [Using the Parallel Stacks Window](using-the-parallel-stacks-window.md)
136-
## [Walkthrough: Debugging a Parallel Application](walkthrough-debugging-a-parallel-application.md)
130+
## [How to: Use the Parallel Stacks Window](using-the-parallel-stacks-window.md)
137131
## [How to: Use the Parallel Watch Window](how-to-use-the-parallel-watch-window.md)
132+
## [How to: Use the Threads Window](walkthrough-debugging-a-multithreaded-application.md)
133+
## [How to: Use the Tasks Window](using-the-tasks-window.md)
138134
## [How to: Use the GPU Threads Window](how-to-use-the-gpu-threads-window.md)
135+
## [Debug On a High-Performance Cluster](how-to-debug-on-a-high-performance-cluster.md)
136+
## [Tips for Debugging Threads in Native Code](tips-for-debugging-threads-in-native-code.md)
137+
## [How to: Set a Thread Name in Native Code](how-to-set-a-thread-name-in-native-code.md)
138+
## [How to: Set a Thread Name in Managed Code](how-to-set-a-thread-name-in-managed-code.md)
139139
# [IntelliTrace](intellitrace.md)
140140
## [Walkthrough: Using IntelliTrace](walkthrough-using-intellitrace.md)
141141
## [IntelliTrace Features](intellitrace-features.md)

docs/debugger/debug-multithreaded-applications-in-visual-studio.md

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Debug Multithreaded Applications in Visual Studio | Microsoft Docs"
33
ms.custom: ""
4-
ms.date: "11/04/2016"
4+
ms.date: "04/21/2017"
55
ms.reviewer: ""
66
ms.suite: ""
77
ms.technology:
@@ -44,25 +44,34 @@ translation.priority.ht:
4444
# Debug Multithreaded Applications in Visual Studio
4545
A thread is a sequence of instructions to which the operating system allocates processor time. Every process that is running in the operating system consists of at least one thread. Processes that have more than one thread are called multithreaded.
4646

47-
Computers with multiple processors, multi-core processors, or hyperthreading processes can run multiple threads at the same time. Parallel processing of multiple threads can greatly improve program performance, but it can also make debugging more difficult because it introduces the need to keep track of multiple threads.
47+
Computers with multiple processors, multi-core processors, or hyperthreading processes can run multiple threads at the same time. Parallel processing of multiple threads can greatly improve program performance, but it can also make debugging more difficult because it introduces the need to keep track of multiple threads.
4848

49-
In addition, multithreading introduces some new types of potential bugs. Often, for example, two or more threads have to access the same resource, but only one thread can safely access the resource at a time. Some form of mutual exclusion is necessary to make sure that only one thread is accessing the resource at a time. If mutual exclusion is performed incorrectly, it can create a *deadlock* condition where no thread can execute. Deadlocks can be a particularly hard problem to debug.
49+
In addition, multithreading introduces some new types of potential bugs. Often, for example, two or more threads have to access the same resource, but only one thread can safely access the resource at a time. Some form of mutual exclusion is necessary to make sure that only one thread is accessing the resource at a time. If mutual exclusion is performed incorrectly, it can create a *deadlock* condition where no thread can execute. Deadlocks can be a particularly hard problem to debug.
50+
51+
Visual Studio provides different tools for use in debugging multithreaded apps.
52+
53+
- For threads, the primary tools for debugging threads are the **Threads** window, thread markers in source windows, **Parallel Stacks** window, **Parallel Watch** window, and the **Debug Location** toolbar. To get started, see [Get started debugging a multithreaded application](../debugger/how-to-use-the-threads-window.md) and [Using the Parallel Stacks window](../debugger/using-the-parallel-stacks-window.md).
5054

51-
Visual Studio provides a **Threads** window, a GPU Threads window, a **Tasks** window, a Parallel Watch window, and other features that make multithreaded debugging easier. The best way to learn about the threading features is by doing the walkthroughs. See [Get started debugging a multithreaded application](../debugger/how-to-use-the-threads-window.md) and [Walkthrough: Debugging a C++ AMP Application](http://msdn.microsoft.com/Library/40e92ecc-f6ba-411c-960c-b3047b854fb5).
55+
- For code that uses the [Task Parallel Library (TPL)](http://msdn.microsoft.com/Library/b8f99f43-9104-45fd-9bff-385a20488a23) or the [Concurrency Runtime](/cpp/parallel/concrt/concurrency-runtime/), the primary tools for debugging multithreaded applications are the **Parallel Stacks** window, the **Parallel Watch** window, and the **Tasks** window (the **Tasks** window also supports JavaScript). To get started, see [Walkthrough: Debugging a Parallel Application](../debugger/walkthrough-debugging-a-parallel-application.md) and [Walkthrough: Debugging a C++ AMP Application](http://msdn.microsoft.com/Library/40e92ecc-f6ba-411c-960c-b3047b854fb5).
56+
57+
- For debugging threads on the GPU, the primary tools is the **GPU Threads** windows. See [How to: Use the GPU Threads window](../debugger/how-to-use-the-gpu-threads-window.md).
5258

53-
Visual Studio also provides powerful breakpoints and tracepoints, which can be very useful when you debug multithreaded applications. You can use breakpoint filters to place breakpoints on individual threads. See [Using Breakpoints](../debugger/using-breakpoints.md)
59+
Visual Studio also provides powerful breakpoints and tracepoints, which can be very useful when you debug multithreaded applications. You can use breakpoint filters to place breakpoints on individual threads. See [Using Breakpoints](../debugger/using-breakpoints.md).
5460

5561
Debugging a multithreaded application that has a user interface can be especially difficult. In that case, you might consider running the application on a second computer and using remote debugging. For information, see [Remote Debugging](../debugger/remote-debugging.md).
5662

5763
## In This Section
5864
[Get started debugging a multithreaded application](../debugger/how-to-use-the-tasks-window.md).
59-
A guided tour of thread debugging features, with emphasis on features how to [!INCLUDE[vs_orcas_long](../debugger/includes/vs_orcas_long_md.md)].
65+
A guided tour of thread debugging features, with emphasis on features in the **Threads** window [!INCLUDE[vs_orcas_long](../debugger/includes/vs_orcas_long_md.md)].
6066

6167
[Debug Threads and Processes](../debugger/debug-threads-and-processes.md)
6268
Explains the basics of debugging threads and processes.
6369

6470
[Debug Multiple Processes](../debugger/debug-multiple-processes.md)
65-
Explains how to debug multiple processes.
71+
Explains how to debug multiple processes.
72+
73+
[How to: Use the Parallel Watch Window](../debugger/how-to-use-the-parallel-watch-window.md)
74+
Inspect values and expressions across multiple threads.
6675

6776
[How to: Use the Threads Window](../debugger/walkthrough-debugging-a-multithreaded-application.md)
6877
Useful procedures for debugging threads with the **Threads** window.
@@ -86,16 +95,10 @@ A thread is a sequence of instructions to which the operating system allocates p
8695
Simple techniques that can be useful for debugging native threads.
8796

8897
[Using the Tasks Window](../debugger/using-the-tasks-window.md)
89-
Shows a list of all the managed or native task objects including their status and other useful info.
90-
91-
[Using the Parallel Stacks Window](../debugger/using-the-parallel-stacks-window.md)
92-
Shows call stacks of multiple threads (or tasks) in a single view and it also coalesces stack segments that are common amongst the threads (or tasks).
98+
Shows a list of all the managed or native task objects including their status and other useful info.
9399

94100
[Walkthrough: Debugging a Parallel Application](../debugger/walkthrough-debugging-a-parallel-application.md)
95-
Walkthrough that shows how to use the Parallel Tasks and Parallel Stacks windows.
96-
97-
[How to: Use the Parallel Watch Window](../debugger/how-to-use-the-parallel-watch-window.md)
98-
Inspect values and expressions across multiple threads.
101+
Walkthrough that shows how to use the Parallel Tasks and Parallel Stacks windows.
99102

100103
[How to: Use the GPU Threads Window](../debugger/how-to-use-the-gpu-threads-window.md)
101104
Examine and work with threads that are running on the GPU during debugging.

docs/debugger/debug-threads-and-processes.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Tools to debug threads and processes | Microsoft Docs"
33
ms.custom: ""
4-
ms.date: "12/09/2016"
4+
ms.date: "04/21/2017"
55
ms.reviewer: ""
66
ms.suite: ""
77
ms.technology:
@@ -51,9 +51,14 @@ translation.priority.ht:
5151
The [!INCLUDE[vsprvs](../code-quality/includes/vsprvs_md.md)] debugger provides powerful but easy-to-use tools for debugging threads and processes.
5252

5353
## Tools and features
54-
The primary tools for working with processes in [!INCLUDE[vsprvs](../code-quality/includes/vsprvs_md.md)] are the **Attach to Process** dialog box, the **Processes** window, and the **Debug Location** toolbar. The primary tools for debugging threads are the **Threads** window, thread markers in source windows, and the **Debug Location** toolbar.
54+
The tools you need to use in [!INCLUDE[vsprvs](../code-quality/includes/vsprvs_md.md)] depend on what type of code you are trying to debug:
55+
- For processes, the primary tools are the **Attach to Process** dialog box, the **Processes** window, and the **Debug Location** toolbar.
56+
57+
- For threads, the primary tools for debugging threads are the **Threads** window, thread markers in source windows, **Parallel Stacks** window, **Parallel Watch** window, and the **Debug Location** toolbar.
5558

56-
The primary tools for debugging multithreaded applications are the **Parallel Stacks** and **Parallel Tasks**, **Parallel Watch**, and **GPU Threads** windows.
59+
- For code that uses the <xref:System.Threading.Tasks.Task> in the [Task Parallel Library (TPL)](http://msdn.microsoft.com/Library/b8f99f43-9104-45fd-9bff-385a20488a23), the [Concurrency Runtime](/cpp/parallel/concrt/concurrency-runtime/) (native code), the primary tools for debugging multithreaded applications are the **Parallel Stacks** windoww, the **Parallel Watch** window, and the **Tasks** window (the **Tasks** window also supports the JavaScript promise object).
60+
61+
- For debugging threads on the GPU, the primary tools is the **GPU Threads** windows.
5762

5863
The following table shows the information available and the actions you can perform in each of these places:
5964

@@ -64,9 +69,9 @@ translation.priority.ht:
6469
|**Threads** window|Threads in current process:<br /><br /> - Thread ID<br />- Managed ID<br />- Category (main thread, interface thread, remote procedure call handler, or worker thread)<br />- Thread Name<br />- Location where thread is created<br />- Priority<br />- Affinity Mask<br />- Suspended Count<br />- Process Name<br />- Flag Indicator<br />- Suspended indicator|Tools:<br /><br /> - Search<br />- Search Call Stack<br />- Flag Just My Code<br />- Flag Custom Module Selection<br />- Group by<br />- Columns<br />- Expand/Collapse callstacks<br />- Expand/Collapse groups<br />- Freeze/Thaw Threads<br /><br /> Shortcut menu:<br /><br /> - Show threads in source<br />- Switch to a thread<br />- Freeze a running thread<br />- Thaw a frozen thread<br />- Flag a thread for additional study<br />- Unflag a thread<br />- Rename a thread<br />- Show and hide threads<br /><br /> Other actions:<br /><br /> - View the call stack for a thread in a DataTip|
6570
|Source window|Thread indicators in left gutter indicate single or multiple threads (off by default, turned on by using shortcut menu in **Threads** window)|Shortcut menu:<br /><br /> - Switch to a thread<br />- Flag a thread for additional study<br />- Unflag a thread|
6671
|**Debug Location** toolbar|- Current process<br />- Suspend the application<br />- Resume the application<br />- Suspend and shut down the application<br />- Current thread<br />- Toggle current thread flag state<br />- Show only flagged threads<br />- Show only current process<br />- Current stack frame|- Switch to another process<br />- Suspend, resume, or shut down the application<br />- Switch to another thread in current process<br />- Switch to another stack frame in current thread<br />- Flag or unflag current threads<br />- Show only flagged threads<br />- Show only the current process|
67-
|**Parallel Stacks** window|- Call stacks for multiple threads in one window.<br />- Active stack frame for each thread.<br />- Callers and callees for any method.|- Filter out specified threads<br />- Switch to Parallel Tasks view<br />- Flag or unflag a thread<br />- Zoom|
68-
|**Parallel Tasks** window|- View information about <xref:System.Threading.Tasks.Task> objects including task ID, task status (scheduled, running, waiting, deadlocked), and which thread is assigned to the task.<br />- Current location in call stack.<br />- Delegate passed to the task at creation time|- Switch to current task<br />- Flag or unflag a task<br />- Freeze or thaw a task|
69-
|**Parallel Watch** window|- The flag column, in which you can mark a thread that you want to pay special attention to.<br />- The frame column, in which an arrow indicates the selected frame.<br />- A configurable column that can display the machine, process, tile, task, and thread.|- Flag or unflag a thread<br />- Display only flagged threads<br />- Switch frames<br />- Sort a column<br />- Group threads<br />- Freeze or thaw threads<br />- export the data in the Parallel Watch window|
72+
|**Parallel Stacks** window|- Call stacks for multiple threads in one window.<br />- Active stack frame for each thread.<br />- Callers and callees for any method.|- Filter out specified threads<br />- Switch to Tasks view<br />- Flag or unflag a thread<br />- Zoom|
73+
|**Parallel Watch** window|- The flag column, in which you can mark a thread that you want to pay special attention to.<br />- The frame column, in which an arrow indicates the selected frame.<br />- A configurable column that can display the machine, process, tile, task, and thread.|- Flag or unflag a thread<br />- Display only flagged threads<br />- Switch frames<br />- Sort a column<br />- Group threads<br />- Freeze or thaw threads<br />- export the data in the Parallel Watch window|
74+
|**Tasks** window|- View information about <xref:System.Threading.Tasks.Task> objects including task ID, task status (scheduled, running, waiting, deadlocked), and which thread is assigned to the task.<br />- Current location in call stack.<br />- Delegate passed to the task at creation time|- Switch to current task<br />- Flag or unflag a task<br />- Freeze or thaw a task|
7075
|**GPU Threads** window|- The flag column, in which you can mark a thread that you want to pay special attention to.<br />- The active thread column, in which a yellow arrow indicates an active thread. An arrow indicates a thread where execution broke into the debugger.<br />- The **Thread Count** column, which displays the number of threads at the same location.<br />- The **Line** column, which displays the line of code where each group of threads is located.<br />- The **Address** column, which displays the instruction address where each group of threads is located.<br />- The **Location** column, which is the location in the code of the address.<br />- The **Status** column, which shows whether the thread is active or blocked.<br />- The **Tile** column, which shows the tile index for the threads in the row.|- Change to a different active thread<br />- Display a particular tile and thread<br />- Display or hide a column<br />- Sort by a column<br />- Group threads<br />- Freeze or thaw threads<br />- Flag or unflag a thread<br />- Display only flagged threads|
7176

7277
## See Also

docs/debugger/using-the-tasks-window.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Using the Tasks Window | Microsoft Docs"
33
ms.custom: ""
4-
ms.date: "11/04/2016"
4+
ms.date: "04/21/2017"
55
ms.reviewer: ""
66
ms.suite: ""
77
ms.technology:
@@ -38,13 +38,13 @@ translation.priority.ht:
3838
- "zh-tw"
3939
---
4040
# Using the Tasks Window
41-
The **Tasks** window resembles the **Threads** window, except that it shows information about <xref:System.Threading.Tasks.Task?displayProperty=fullName>, [task_handle](/cpp/parallel/concrt/reference/task-group-class.md), or [WinJS.Promise](http://msdn.microsoft.com/library/windows/apps/br211867.aspx) objects instead of each thread. Like threads, tasks represent asynchronous operations that can run concurrently; however, multiple tasks may run on the same thread. See [Asynchronous programming in JavaScript (Windows Store apps)](http://msdn.microsoft.com/library/windows/apps/hh700330.aspx) for more information.
41+
The **Tasks** window resembles the **Threads** window, except that it shows information about <xref:System.Threading.Tasks.Task?displayProperty=fullName>, [task_handle](/cpp/parallel/concrt/reference/task-group-class.md), or [WinJS.Promise](http://msdn.microsoft.com/library/windows/apps/br211867.aspx) objects instead of each thread. Like threads, tasks represent asynchronous operations that can run concurrently; however, multiple tasks may run on the same thread.
4242

4343
In managed code, you can use the **Tasks** window when you work with <xref:System.Threading.Tasks.Task?displayProperty=fullName> objects or with the **await** and **async** keywords (**Await** and **Async** in VisualBasic). For more information about tasks in managed code, see [Parallel Programming](http://msdn.microsoft.com/Library/4d83c690-ad2d-489e-a2e0-b85b898a672d).
4444

4545
In native code, you can use the **Tasks** window when you work with [task groups](/cpp/parallel/concrt/task-parallelism-concurrency-runtime), [parallel algorithms](/cpp/parallel/concrt/parallel-algorithms), [asynchronous agents](/cpp/parallel/concrt/asynchronous-agents), and [lightweight tasks](/cpp/parallel/concrt/task-scheduler-concurrency-runtime). For more information about tasks in native code, see [Concurrency Runtime](/cpp/parallel/concrt/concurrency-runtime).
4646

47-
In JavaScript, you can use the Tasks window when you are working with promise .then code.
47+
In JavaScript, you can use the Tasks window when you are working with promise .then code. See [Asynchronous programming in JavaScript (Windows Store apps)](http://msdn.microsoft.com/library/windows/apps/hh700330.aspx) for more information.
4848

4949
You can use the **Tasks** window whenever you break into the debugger. You can access it on the **Debug** menu by clicking **Windows** and then clicking **Tasks**. The following illustration shows the **Tasks** window in its default mode.
5050

0 commit comments

Comments
 (0)