17

I would like to see the threads currently active in my application while debugging it.

How can I do this using Visual Studio?

George Mauer
  • 117,483
  • 131
  • 382
  • 612

7 Answers7

41

Yes, go to Debug->Windows->Threads

RichS
  • 3,097
  • 30
  • 26
  • 1
    Cannot find `Debug > Windows > Threads` in Visual Studio 2019 Community, but the `Ctrl + Alt + H` key combination does the trick. – Toni Jun 07 '21 at 09:41
16

Debug | Windows | Threads

or

Ctrl+Alt+H

Toni
  • 1,555
  • 4
  • 15
  • 23
Ferruccio
  • 98,941
  • 38
  • 226
  • 299
7

While RichS' answer is technically correct, the information displayed in that window is not as helpful if you have a number of thread in wait states or sleeping.

I would recommend you make sure you name your threads for better visibility in the Thread window. Use the Thread.Name property to assign a meaningful name to your thread. You'll be glad you did.

Bill
  • 1,738
  • 10
  • 22
5

If you are using VS 2008, check this screencast on VS 2008 multi-threading improvements..

Gulzar Nazim
  • 51,744
  • 26
  • 128
  • 170
2

Also, give your threads names when you create them, it makes it easier to identify them in the threads tool window in visual studio.

0

I've been using Allinea's DDTLite plugin recently - drops into VS2008 (SP1) pretty well and gives a number of really really useful windows for managing multiple threads (stepping, breakpoints, ..) or even just seeing where threads are at the same time (a sort of tree like view of the stacks, it's really cool).

0

You can simply track the threads either through visual studio or just from task manager. In the case of VS- after debugging your application just navigate to debug from upper menu options then goto to windows and then threads. Debug->Windows->Thread. sometimes you might not get information from VS thread windows so go to task manager from desktop and navigate to thread column. refer the image below. Here you go

Iqra.
  • 685
  • 1
  • 7
  • 18
  • Already covered by the accepted answer. Its also worth noting, that task manager just tells you the *number* of threads and doesn't show you info on the threads themselves. To do that you need something like procexplorer – George Mauer May 05 '17 at 15:43