Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Virtual Machine / March 2004

Tip: Looking for answers? Try searching our database.

program stops

Thread view: 
Kovan Akrei - 16 Mar 2004 11:05 GMT
Hi,
I have a multi thread simulation program written in java. In this program I
use threads to simulate processes in a discrete event simulation. During
program execution many hundred thousend threads are created, started and
stopped.
When compiling and running the same program om a sun machine with java 1.2.2
it runs wothout any problems.
Problems appear on win2000 and winXP platform based machines. I do compile
and execute the program in a console window on these oses (win2000 and xp).
My new compiled program sometimes just stops doing what it should be doing.
The program process is alive but the cpu is idle (it should going hundred).
I have installed java 1.4.03 on my machine.This only happens on win2000 og
xp.

Is there anybody out there who knows what the problem seems to be? Does the
problem seems to be Java version ?

regards from
Kovan Akrei
Chris Uppal - 16 Mar 2004 13:11 GMT
> My new compiled program sometimes just stops doing what it should be
> doing. The program process is alive but the cpu is idle (it should going
> hundred).

Sounds as if you have a logic error that is deadlocking your code.  The error
could be in the system code, but I think it's more likely to be in your own
(which is a good thing because it means you have a chance to fix it).

Debugging threading problems is never easy.  If you can't reproduce it under a
debugger then you can try pressing <control>+<break> (iirrc) when your app is
deadlocked which should cause the JVM to print out a trace of what each thread
is doing.  That -- and lots of hard thinking -- should get you started on
looking for the problem.

   -- chris
Kovan Akrei - 16 Mar 2004 16:33 GMT
I have recompiled the java files using java 1.2.2_15 on winXP and retested
(many time) the program wothout any problems. But even with the news java
(1.4.2_04) I get the same problem. And it happens almost all the time. I
have analyzed the program and found a problem. when using java 1.4.2_04 alle
the threads ends up in waiting state. This shouldnot happen and it does not
happen in 1.2.2_15.

Kovan

> > My new compiled program sometimes just stops doing what it should be
> > doing. The program process is alive but the cpu is idle (it should going
[quoted text clipped - 11 lines]
>
>     -- chris
Chris Uppal - 16 Mar 2004 17:26 GMT
> I have recompiled the java files using java 1.2.2_15 on winXP and retested
> (many time) the program wothout any problems. But even with the news java
> (1.4.2_04) I get the same problem. And it happens almost all the time. I
> have analyzed the program and found a problem. when using java 1.4.2_04
> alle the threads ends up in waiting state. This shouldnot happen and it
> does not happen in 1.2.2_15.

It is, however, most likely to be a problem in your code that happens not to
manifest in a 1.2.x JVM.   Just because a program (*especially* a threaded
program) works on one JVM, but does not on another, in no way implies that
there is a problem in either JVM implementation.  Since it is so *very*
difficult to get threaded code right, if I were in your position then I would
assume that the problem was in my code.

That's not *certain* of course, but I personally would not waste time trying to
find bugs in 1.4.2 until after I fully understood how my application ended up
in that state.

   -- chris
Kovan Akrei - 16 Mar 2004 18:04 GMT
> It is, however, most likely to be a problem in your code that happens not to
> manifest in a 1.2.x JVM.   Just because a program (*especially* a threaded
> program) works on one JVM, but does not on another, in no way implies that
> there is a problem in either JVM implementation.  Since it is so *very*
> difficult to get threaded code right, if I were in your position then I would
> assume that the problem was in my code.

That's true. I think the error is in the code. I havn't written the code. I
have downloaded from the net. I'm just testing it and comparing it to my own
code written in C# (CSharp). Both codes are very similar to each other. My
code has no problems. I have been running long simulations without any
problem.

> That's not *certain* of course, but I personally would not waste time trying to
> find bugs in 1.4.2 until after I fully understood how my application ended up
> in that state.

I wont do that :)

Thanks for your help.
Bryan Kennedy - 16 Mar 2004 17:34 GMT
Instead of getting enough sleep Chris Uppal was saying:

> Debugging threading problems is never easy.  If you can't reproduce
> it under a debugger then you can try pressing <control>+<break>
> (iirrc) when your app is deadlocked which should cause the JVM to
> print out a trace of what each thread is doing.  That -- and lots of
> hard thinking -- should get you started on looking for the problem.

If you're living in a *nix world you can send the java process SIGQUIT
to get this thread info printed to stderr.  

Signature

Bryan Kennedy                     e-mail: bryan.kennedy@cc.gatech.edu



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.