• Answers
  • Web
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

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

Explore Related Questions

Other people asked questions on similar topics, check out the answers they received:


Q:

My question is about En_vs_2005_Pro_90_Trial.img ...

My question is about En_vs_2005_Pro_90_Trial.img. I downloaded this file with DAP and now I can't get it to open. I also ...
Submitted by cstec   2 years ago.
  • viewed 729 times
Last answer posted 2 years ago by Philly


Q:

Debugging c# without Visual-Studio installed?

How do I debug .NET application when Visual-Studio is not installed? Is there an independant debugging utility for C#, as WinDBG ...
Submitted by Paz   2 years ago.
  • viewed 3073 times
Last answer posted 2 years ago by Eran


Q:

WinDbg and C# Applications

What is WinDbg and can I use it to debug applications written in C#?
Submitted by kazabubu   3 years ago.
  • viewed 3476 times
Last answer posted 3 years ago by hmemcpy



» More...

Explore Related Posts in Forums

C-C-C-C-Combo

C-C-C-C-Combo C-C-C-C-C-Combo

C-c-c-c-cold

I do notice that after I lost 80 pounds, I now feel colder during the fall and winter months. I also think it has something... to do with getting older. David Yes, I much colder than I use to be, but I do not take insulin...I'm on oral meds. It could be the insulin, or thyroid, or...

6/11 - C C Penny pitch. C C Sox win. C C Sabathia die like a dog.

The Sox lead the Yankees 7-0 on the season for the first time since 1912, when: the Titanic sank; Fenway Park opened; France... legalized sodomy ; and some German synthesized MDMA (aka ecstasy). So let's sodomize these Titanic-salaried bastards... Lead pipe these sumbitches. This post has been edited by JohnnyTheBone : Jun 11 2009, 09:14 AM
» More...
Powered by
Feed - Subscribe to changes to this Q&A Blog
ADVERTISEMENT
  • Answers
  • Web
Copyright © 2006-2010, Yedda Inc. and respective copyright owners · CC License