473,379 Members | 1,170 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 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 4769
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.