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.


Would you like to answer or comment?

Sign up for a free account, or sign in (if you're already a member).
Share Send to a friend Watch Report
 

Best Answer

 
520 thumbs up

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 1 year ago ( permalink )
In reply to c_i_wood's question
Eran was invited by Yedda to answer this question.

Rated as
Best Answer
0
1

Helpful?

line
line
line


 

All Answers

 

Posted 1 year ago ( permalink )
Rated as
#2 out of 2
0
0

Helpful?

line
line
line



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:


WinDbg and C# Applications

What is WinDbg and can I use it to debug applications written in C#?
Submitted by kazabubu 2 years ago
  • viewed 1847 times

Last answer posted 2 years ago by hmemcpy


Internet explorer has encountered a problem and needs to close

How do you get rid of the error message that says, internet explorer has encountered a problem and needs to close..I have done the ...
Submitted by GUARDIANANGEL 2 years ago
  • viewed 168666 times

Last answer posted 5 days ago by GUARDIANANGEL


When I access my space this box pops up and says I ...

When I access my space this box pops up and says I need to debug and I have no idea how to do that. I try to search the web and ...
Submitted by Kelly 1 month ago
  • viewed 50 times

Last answer posted 1 month ago by Kelly



» More...

Explore Related Posts in Forums

C-c-C-C-C-C-C-C-OMBO BREAKE

Already been said. http://iwforums.com/showpost.php?p=324638&postcount=27 Nice find PaulyQuote: : Already been said. http://iwforums.com/showpost.php?p=324638&postcount...

C-C-C-C-C-Coimbo breaker

have too many C's FAIL.Quote: : Jag BTW you have too many C's FAIL. Don't forget...

C-c-c-c-c-combo Breaker!

is irrelevant >_>c-C-C-C-C-C-C-C... PROPS TO MEGAMATT FOR FUCKING AWESOME WIN
» More...
Powered by
Feed - Subscribe to changes to this Q&A Blog

Explore Related Videos

JC Penney's Holiday Ad Campaign

J.C. Penney's new holiday ad campaign is aimed at cash-strapped consumers looking for high-end gifts, but at lower prices. (Nov. 12)

Obama Names Volcker to Head New Econ Advisers

President-elect Barack Obama chose former Federal Reserve Chairman Paul Volcker Wednesday to head a new White House panel to help create jobs and bring stability to the ailing financial system. Video by AP

Tot Helps Mom Deliver Sib

A Surf City, N.C. 6-yr.-old used his shoelace to tie the umbilical cord when his mom unexpectedly delivered at home. Julie Chen spoke to the family.

Terrorists Target India

U.S. officials say they do not know who is behind the deadly terrorist attacks in Mumbai, India. Since 2003, more than 600 people have died in India as a result of terrorism. Bob Orr reports. Video by CBSNEWS.com

The Communicators: Congress &...

Rep. Bart Stupak (D-MI) discusses potential changes to telecommunications policy in light of a new administration and an increase of Democrats in Congress. He is joined by Todd Shields, a reporter at Bloomberg News. Program from Saturday, Nov. 22, 2008.

The Man With A Plan

During the second of three expected news conferences, President-elect Barack Obama reassured the nation that he is ready to take over on Jan. 20th. Dean Reynolds reports. Video by CBSNEWS.com

Region Gears Up for Holiday Travel

Despite a decrese in air and car travel, D.C. area residents are preparing to travel for Thanksgiving. Video by News Channel 8/WJLA-TV 7

C-SPAN Bus update week of 10/17/08 LIttle...

A C-SPAN Campaign Bus update from the Harry S. Truman Little White House.

The U.F.O. Affair

April is kidnapped after discovering a crime syndicate's plan to use a U.F.O. to retrieve the gold from Kuwait's treasury.

Davis' Three TDs Lead Clemson Past South...

Clemson tops South Carolina, 31-14
» More...
Powered by