aspose file tools*
The moose likes Beginning Java and the fly likes Daemon Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Daemon" Watch "Daemon" New topic
Author

Daemon

shri Sonparote
Ranch Hand

Joined: May 07, 2007
Posts: 30
Hi
All
Why Daemon thread have low priority?

Regrads
Shrikant
Svend Rost
Ranch Hand

Joined: Oct 23, 2002
Posts: 904
Hi,

I dont know if this answer is "enough".. if not, just reply back

A deamon thread is a service provider for other threads.. [edited away]

JavaWords Introduction to Threads page 3 deals with deamon threads (among other things).

/Svend Rost
[ July 19, 2007: Message edited by: Svend Rost ]
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42913
    
  68
Being a daemon/non-daemon thread, and the thread priority are unrelated concepts. So a daemon can have high or low priority, as can a non-daemon thread.

Of course, often it is true that daemon threads have low priority, because they perform non-critical operations (if they didn't, they should not be daemon threads to begin with).

It is generally recommended that the priority of threads not be changed by the setPriority method (which means it should not be changed at all), and that it should be left to the JVM which thread to schedule.
[ July 19, 2007: Message edited by: Ulf Dittmer ]
Svend Rost
Ranch Hand

Joined: Oct 23, 2002
Posts: 904
Hi Ulf, thanks for correcting me. I wasn't aware that deamon threads could have higher priority than non deamon theads.
D Rog
Ranch Hand

Joined: Feb 07, 2004
Posts: 472

daemon has relation only to termination VM logic, not priority.


Retire your iPod and start with HD Android music player Kamerton | Minimal J2EE container is here | Light weight full J2EE stack | and build tool | Co-author of "Windows programming in Turbo Pascal"
shri Sonparote
Ranch Hand

Joined: May 07, 2007
Posts: 30
Thanks to all of you

Regards
Shrikant
 
jQuery in Action, 2nd edition
 
subject: Daemon