Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Daemon

 
shri Sonparote
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
All
Why Daemon thread have low priority?

Regrads
Shrikant
 
Svend Rost
Ranch Hand
Posts: 904
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 904
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 472
Linux Objective C Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
daemon has relation only to termination VM logic, not priority.
 
shri Sonparote
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks to all of you

Regards
Shrikant
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic