Link to home
Start Free TrialLog in
Avatar of Ravikumarv
Ravikumarv

asked on

Debug Multithreaded programming

Hi,

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

Thanks,
Ravi.
ASKER CERTIFIED SOLUTION
Avatar of Member_2_1001466
Member_2_1001466

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of guntherothk
guntherothk

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.

Avatar of Ravikumarv

ASKER

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