Solved

Debug Multithreaded programming

Posted on 2004-10-11
4
346 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 50 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
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.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

828 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