Skip to Main Content

Java HotSpot Virtual Machine

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How does Thread scheduling work?

843811Aug 10 2001 — edited Aug 10 2001
I'm having a problem with a Java application which uses C++ code. My program consists of multiple threads, most of which at any time are either inside a Thread.sleep() method or an Object.wait() [with timeout] method. I'm running on SCO OpenServer 5.0.6.

My program will run fine for several hours and then the JVM will stop scheduling threads. The sleep methods are sleeping for only 500 ms but those threads never return from the sleep. If I send a SIGALRM to the JVM it will reschedule the threads, so I'm thinking somewhere in the excecution of the program a SIGALRM got dropped. The C++ code does make use of alarms to implement timeouts, but so far I have found no evidence of it getting the alarm signal. The amount of time the program runs before encountering this problem appears to be random.

Does anyone know how the JVM schedules threads, and can tell me whether I'm on the right track? I'd appreciate any help I can get. Thanks!

Robert
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 7 2001
Added on Aug 10 2001
1 comment
202 views