Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Debugging a multi-threaded application

I have inherited an application that throws up 100 threads at the start. This makes my debugging life extremely tricky. Is there a way of getting Visual Studio to follow one thread?

like image 625
Neil Knight Avatar asked Dec 06 '10 09:12

Neil Knight


2 Answers

Have you tried using the 'Threads' window in Visual Studio (in Debug / Windows menu) ?

You can freeze threads and switch between them

like image 59
Dean Chalk Avatar answered Nov 11 '22 16:11

Dean Chalk


If possible, I suggest that in Debug mode you limit the number of threads that are created, to a much more manageable number, e.g., 3. That way you can still can diagnose bugs due to interaction between threads, but you are not completely snowed under.

like image 24
Polyfun Avatar answered Nov 11 '22 15:11

Polyfun