Skip to content

Latest commit

 

History

History
44 lines (32 loc) · 1.92 KB

how-to-switch-to-another-thread-while-debugging.md

File metadata and controls

44 lines (32 loc) · 1.92 KB
title description ms.date ms.topic dev_langs helpviewer_keywords author ms.author manager ms.subservice
Switch to another thread while debugging
Review different methods to switch to another thread while debugging a multithreaded application in Visual Studio.
04/27/2017
how-to
CSharp
VB
FSharp
C++
threads, switching [debugging]
mikejo5000
mikejo
mijacobs
debug-diagnostics

Switch to Another Thread While Debugging in Visual Studio (C#, Visual Basic, C++)

When you debug a multithreaded application, you can use any one of several methods to switch from the thread that you have been working with to another thread.

Note

If you want to control the order in which threads execute, you need to freeze and thaw threads.

When you examine threads in the code editor and the different multithreaded debugging windows, the yellow arrow indicates the current thread. A green arrow with a curly tail indicates that a non-current thread has the current debugger context.

To switch to any thread that appears

  • In the Threads or Parallel Watch window, double-click the thread.

To switch to a thread in a source window

  • In the left gutter, right-click a thread marker icon Thread Marker, point to Switch to, and then click the name of that thread to which you want to switch. The shortcut menu shows only the threads at that specific location.

    If no thread markers appear, right-click in the Threads window and verify that Show Threads in Source is selected.

To switch to a thread in the Debug Location toolbar

  1. On the Debug Location toolbar, click the Thread list.

  2. In the list, click the thread to which you want to switch.

Related content