wood burning stoves 2.0
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Priority of Daemon threads Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Priority of Daemon threads" Watch "Priority of Daemon threads" New topic

Priority of Daemon threads

Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8927

What is the priority of Daemon threads?

Jessica Sant

Joined: Oct 17, 2001
Posts: 4313

The default priority of a thread is 5. (however you can change a thread's priority with .setPriority(int).
The priority of a thread is inherited from its parent thread, also the TYPE of thread (daemon or not) is inherited from the parent.
Check out this blip from the API for Thread

When code running in some thread creates a new Thread object, the new thread has its priority initially set equal to the priority of the creating thread, and is a daemon thread if and only if the creating thread is a daemon....

does that help?
[ February 14, 2003: Message edited by: Jessica Sant ]

- Jess
Blog:KnitClimbJava | Twitter: jsant | Ravelry: wingedsheep
I agree. Here's the link: http://aspose.com/file-tools
subject: Priority of Daemon threads
jQuery in Action, 3rd edition