[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Debug Multithreaded programming

Posted on 2004-10-11
4
Medium Priority
?
351 Views
Last Modified: 2010-04-01
Hi,

Can anyone explain how to debug a multithreaded programme in Windows, Unix and Linux.

Thanks,
Ravi.
0
Comment
Question by:Ravikumarv
  • 2
4 Comments
 
LVL 13

Accepted Solution

by:
SteH earned 150 total points
ID: 12275616
You can set breakpoints as usual. When hit you can single step around that line. Thus you basically have the possiblity to debug each single thread, since other threads should not be affected from this breaking.

If you need to debug how th threads interact you are in trouble. I think to remember that there exist debugging tools for that purpose as well but don't expect them to be cheap or free.

Can you be a bit more specific on what you want to debug?
0
 
LVL 2

Expert Comment

by:guntherothk
ID: 12277395
A huge question, for 50 points. My 50 point answer is "use the debugger in Windows, Unix, and Linux.

In windows, when you set a breakpoint, the first thread that hits the breakpoint stops execution, and you can examine all the threads. The debug/threads menu pick lets you look at another thread. Typically you'll be in assembly language view, but you can use the stack window to pick the point of call, which will be a source view. The threads dialog will let you suspend all the threads but one if you want. Debugging on Unix and Limus is similar, but you will have to look up the commands.

I suspect you want to ask a more specific question, like how to debug some specific multithreaded problem you are having.

0
 

Author Comment

by:Ravikumarv
ID: 12283887
Hi,
  Thank you all for your answers.
  I am not able to understand this debug/thread menu.  Where can i find it. I mean in the VC++ compiler. What I want to see is the values of the thread specific varriables at a specific point of execution.

Thanks,
Ravi.
0
 
LVL 13

Expert Comment

by:SteH
ID: 12284504
The debug menu, where this funcionality resides is only visible when you are debugging code.

When a breakpoint was reached you can get a dialog to choose a thread via Debug->Threads
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
Suggested Courses

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question