views:

1382

answers:

6

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

How can I do this using Visual Studio?

+7  A: 

Yes, go to Debug->Windows->Threads

RichS
+5  A: 

Debug | Windows | Threads

or

Ctrl-Alt-H

Ferruccio
+2  A: 

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

Gulzar
+3  A: 

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
A: 

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

A: 

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).