472,961 Members | 1,500 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,961 software developers and data experts.

Multithreaded debugging?

What's the best way to debug a multithread program?

I'm using JBuilderX (Foundation), not sure if this has decent
multithread debug capabilities, are there any good tutorials out there
that explain how to do it in JBuilder?

I'm not so botherered about synchorisiation, I just have several
independedent threads happening at once and I'd like to be able to
step through one thread at a time as if it was an ordinary program
with the other threads not there.
Jul 17 '05 #1
3 4747
I've developed several multi-threaded applications with JBuilder. in
fact, i cannot imagine trying to get one done without it.

give it a whirl, place break points inside separate threads, watch the
debugger handle it with no problems at all....

- perry

Charles Fox wrote:
What's the best way to debug a multithread program?

I'm using JBuilderX (Foundation), not sure if this has decent
multithread debug capabilities, are there any good tutorials out there
that explain how to do it in JBuilder?

I'm not so botherered about synchorisiation, I just have several
independedent threads happening at once and I'd like to be able to
step through one thread at a time as if it was an ordinary program
with the other threads not there.


Jul 17 '05 #2
Thanks for your reply, however,

I don't quite get how JBuilder does this -- I have tried putting
breakpoints in parts of the code run by each thread, but I find that
when I step though the code, it randomly skips between threads. I
need to be able to step through a single thread and ignore the other
threads. Am I missing something? I've tried right-clicking the
thread icon in the 'threads,call stacks,data' window and selecting
'steppign thread' but it doesn't seem to do anything different. Are
there any instructions on the web with details of how to do this? I
can't find anything!
Jul 17 '05 #3
"but I find that when I step though the code, it randomly skips between
threads."

you have to realize that it is part of the java specification to allow
threads to execute whenever and however they want. no part of the
contract says that one thread must execute before, during or after
another. in fact, it's technically possible for the java runtime to hold
a thread altogether until it feels it's ready to run it.

if your seeing this behaviour then the good news is, is that your jre is
working fine.

as for stepping thru a single thread, do so! as for the other threads in
the background doing there thing, this is where design comes into play.
your problems are not with the thread implementation provided by java,
it's with your need for a good thread synchronization strategy. there's
a very good book dedicated to JavaSpaces that provides plenty of cool
ways to get threads to share a resource or share a work in progress.

http://www.awprofessional.com/title/0201309556

the cool part of this is that you get to learn this and apply your own
ideas on it today!

amazon has a good book review too. but don't get side tracked into
thinking that you need JavaSpaces on top of what you are already doing.
JavaSpaces was intended to simplify a distributed application over Jini.
In your case, you'll be more interested in the design patterns.

This I think is what you are really after.

Feel free to email me directly for more on this.

- perry

pe***@cplusplus.org
Charles Fox wrote:
Thanks for your reply, however,

I don't quite get how JBuilder does this -- I have tried putting
breakpoints in parts of the code run by each thread, but I find that
when I step though the code, it randomly skips between threads. I
need to be able to step through a single thread and ignore the other
threads. Am I missing something? I've tried right-clicking the
thread icon in the 'threads,call stacks,data' window and selecting
'steppign thread' but it doesn't seem to do anything different. Are
there any instructions on the web with details of how to do this? I
can't find anything!


Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: John Lull | last post by:
I'm writing a multithreaded COM server to manage a pool of hardware resources. All objects are designed to be thread-safe, and I've set sys.coinit_flags to COINIT_MULTITHREADED before importing...
1
by: Elbert Lev | last post by:
I started with Python two weeks ago and already saved some time and efforts while writing 2 programs: 1. database extraction and backup tool, which runs once a month and creates a snapshot of...
3
by: Anthony | last post by:
Hi, How does (Can?) the stream mechanism work in multithreaded programs? I want to implement cout in my multithreaded program.
2
by: pradyumna | last post by:
In Project settins - C/C++ - Code Generation, what is the difference between the option "Multithreaded" and "Multithreaded DLL". I understand that on selecting multithreaded option, single and...
3
by: Development | last post by:
I am creating 10 threads that do ecatly the same thing. I am having a very hard time debugging this scenario. It seems that by default when you are doing f10 or f11 all threads execute. You can...
4
by: Bruno van Dooren | last post by:
Hi, i was debugging a multithreaded app, when i stumbled across some weird behavior of the debugger. in the destructor of my main object i send a stop event to the worker thread, and then...
7
by: Pavils Jurjans | last post by:
Hello, I wanted to get some light in the subject. As I develop ASP.NET applications, it's necessary to understand how exactly the server- communication happens. It seems like initially...
6
by: KK | last post by:
Dear All My requirement is to write class that is thread safe.( All public methods & static methods must be thread safe ). I found two options to implement this 1.using...
4
by: Armin Zingler | last post by:
Hi, how can I debug multithreaded apps in the express version? There is no threads window. I press Break, but I always see the same thread. But I want to debug the other thread that I started....
5
by: John Henry | last post by:
I am back against the wall trying to migrate my multithreaded application from Python 2.3 to 2.5. The part of the code that's failing has to do with queues (2.3 queues and 2.5 queues are not the...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
2
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.