dcsimg
How to start thread with a low priority?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Sergey_Opanasets
Posted On:   Saturday, January 19, 2002 05:26 AM

In application we have alarm scheduler, that runs in a separate thread. For scheduler we are using third-party open source implementation. When this module was added to the application, processor utilization never falls below 80%, even when application does not do anythins. I wonder if there is a way to inform JVM that this thread is the last one it should invoke, and only when nothing else is running?

Re: How to start thread with a low priority?

Posted By:   Anonymous  
Posted On:   Saturday, January 19, 2002 03:35 PM

You can set priorities on Threads, just have a look at the JavaDocs ...


Allthough, I would be VERY carefull with that (I NEVER use it), because this priority system relies heavily on the underlying thread implementation of your OS, and your app won't run the same on all platforms ...)


Odds are great that somewhere in the code is some stupid tight loop that is eating your CPU ... try to locate it and sleep the current thread for 10 milliseconds or so at that place ..




Regards,



G√ľnther.

http://www.javacoding.net

About | Sitemap | Contact