Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Debugging C# Threads

When I am working on multithreads how can I debug to know which thread causes an abnormal behavior?

Can I use permonitor for debugging, or are there any other tools or debugging facilities that are available?

like image 648
user186973 Avatar asked Oct 10 '09 16:10

user186973


3 Answers

  • Tips for Debugging Threads From MSDN
  • Neat New Multithreaded Debugging Features in VS 2008 by John Robbin
like image 73
Hannoun Yassir Avatar answered Oct 04 '22 15:10

Hannoun Yassir


As an alternative to debugging, you could do thread-related testing. The book The Art of Unit Testing has a section on this in Appendix B. The author mentions three tools (two of which he has a personal interest in):

  • Typemock Racer
  • Microsoft CHESS
  • Osherove.ThreadTester
like image 39
TrueWill Avatar answered Oct 04 '22 16:10

TrueWill


You can use visual studio to set up breakpoints on certain threads. See here and here for how to do it.

like image 36
George Stocker Avatar answered Oct 04 '22 15:10

George Stocker