Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Is knowledge of Daemon threads required for 1.4?

 
Brian Joseph
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I noticed a couple of questions on these, and my book did not cover them. Is it worth knowing these for the 1.4 exam?
 
Corey McGlone
Ranch Hand
Posts: 3271
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Daemon threads aren't really that different from a normal thread. The key is that they are then dependent upon another process. When that thread dies, so too, does the daemon thread.
I would expect daemon threads to appear on the exam.
 
Jessica Sant
Sheriff
Posts: 4313
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think the main things you need to understand about Daemon threads is that the JVM will exit once there are no non-Daemon threads (user threads) running. Also, when you spawn a thread it will get the same status as the thread that created it, unless explicitly set using setDaemon(boolean).
 
Anupam Sinha
Ranch Hand
Posts: 1090
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
setDaemon(boolean) can only be used if the thread has not been started.
[ June 20, 2003: Message edited by: Anupam Sinha ]
 
Brian Joseph
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for those quick tips!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic