Personalize Yedda, (And make Danny Happy)
People ask & answer about almost everything. Tell us what you're interested in... So we can personalize Yedda especially for you
I'm interested in:
Originated from
Advanced .NET Debugging

Multithreaded C# debugging troubles

My multithreaded C# application in VS2005 often refuses to break into threads other than the main thread. It hits my breakpoints but after an awful pause. If I then try to step through the code execution resumes and my thread exits with an exception. What's going on? I've installed Service Pack 1 for VS2005 and it didn't help.


Share Send to a friend Watch Report
 

Best Answer

 
207 helpful answers

They're coming to take me away, Ha-haaa!

Advanced .NET Debugging Blog

My personal blog

The question is how threaded is your application. Debugging a highly threaded application in visual studio may cause some performance problems while debugging.

First, you should make sure that your main thread is bullet proof and won't finish before you finish debugging the other threads you wish to debug.

It is also important to notice that if a certain code runs on a couple of different threads (not shared, but a couple of threads perform the same operation using the same code) it will be very tricky to debug it since the breakpoint is set on a specific code and not on a specific thread.

I would try and use a little "printf" debugging and write things to the log (with the thread id, of course). 

In addition to that, what is the exception you are seeing?

Posted 2007-09-20T13:21:57Z
Eran was invited by Yedda to answer this question.

Helpful?(1)
Rated as Best Answer

 

All Answers

 
207 helpful answers

They're coming to take me away, Ha-haaa!

Advanced .NET Debugging Blog

My personal blog

The question is how threaded is your application. Debugging a highly threaded application in visual studio may cause some performance problems while debugging.

First, you should make sure that your main thread is bullet proof and won't finish before you finish debugging the other threads you wish to debug.

It is also important to notice that if a certain code runs on a couple of different threads (not shared, but a couple of threads perform the same operation using the same code) it will be very tricky to debug it since the breakpoint is set on a specific code and not on a specific thread.

I would try and use a little "printf" debugging and write things to the log (with the thread id, of course). 

In addition to that, what is the exception you are seeing?

Posted 2007-09-20T13:21:57Z
Eran was invited by Yedda to answer this question.

Helpful?(1)
Rated as Best Answer

Sign in to participate

Got an answer for c_i_wood? Would you like to comment on the posted answers, or vote for the one which you think is the best?

Sign up for a free account, or sign in (if you're already a member).

Feed - Subscribe to changes to this Q&A Blog
ADVERTISEMENT
  • Answers
  • Web
Copyright © 2006-2009, Yedda Inc. and respective copyright owners · CC License