This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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: 8904

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:
subject: Priority of Daemon threads
Similar Threads
Daemon Thread
Two queries
user threads and daemon threads
What is Demon thread and what is Green thread