Using the Threads Window
The Threads window contains a table for each row that represents one thread in the application. By default, the table lists all the threads in your application, but you can filter the list to show only the threads that you are interested in. Each column contains different types of information. You can also hide some columns. If all columns are displayed, the following information is displayed from left to right:
Flag column, where you can mark threads that you want to be particularly concerned about.
The active thread column, where a yellow arrow indicates an active thread. The outline of the arrow indicates the thread that executes the decomposition in the debugger.
ID column, which contains the identification number of each thread.
The managed ID column, which contains the managed identification number of the managed thread.
Category column, which divides threads into user interface threads, remote procedure call handlers, or worker threads. A special category identifies the main thread of the application.
The Name column, if a thread is identified by name, or "< No Name >" is identified.
The location column, which shows where the thread is running. You can expand this location to display the full call stack of the thread.
The priority column, which contains the priority that the system has assigned to each thread.
Association mask column, advanced column, usually hidden. This column displays the processor affinity mask for each thread. In multiprocessor systems, the association mask determines which processors the thread can run on.
The suspended column containing the suspend item count. This count determines whether a thread can run.
The Process Name column, which contains the processes that each thread belongs to. This column is useful when you are debugging multiple processes, but this column is usually hidden.
Toggle Active Thread
Perform any of the following steps:
Double-click any thread.
Right-click a thread, and then clicking Switch to Thread.
The yellow arrow appears next to the new active thread. The gray outline of the arrows identifies the thread that executes the decomposition in the debugger
Show thread Call stack
In a multithreaded program, each thread has its own call stack. The Threads window provides an easy way to view these stacks.
View the call stack for the thread, and in the Location column, click the inverted triangle next to the thread position. This location expands to display the call stack of the thread.
extended reading: Debugging a parallel program with Visual Studio 2010 Visual Studio 2010 provides a powerful tool for debugging parallel programs, and after you have programmed a breakpoint, you can use the Threads window to view all the threads of the current program: Double-click a row in Figure 19‑9 to make the specified thread a "debugged" thread that is currently active. In addition, the Parallel Tasks window shows all the tasks the current program is running: In the Parallel stacks window, you can visually see the call stack for each thread: For instructions on how to use the Visual Studio 2010 debugger, check MSDN. This book is no longer to repeat.
in addition,
Extended reading: Debugging a parallel program with Visual Studio 2010 Visual Studio 2010 provides a powerful tool for debugging parallel programs, and after you have programmed a breakpoint, you can use the Threads window to view all threads of the current program: In Figure 19‑9, you can double-click a row to make the specified thread a "debugged" thread that is currently active. In addition, the Parallel Tasks window shows all the tasks the current program is running: In the Parallel stacks window, you can visually see the call stack for each thread: For instructions on how to use the Visual Studio 2010 debugger, check MSDN. This book is no longer to repeat.