Solved

Debug Multithreaded programming

Posted on 2004-10-11
4
348 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
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 learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

707 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