This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

daemon thread.

 
jaman tai
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
With respect to User and Daemon threads:

a) Daemon threads can not be destroyed

b) Running User threads prevent a JVM from terminating program

c) Running Daemon threads prevent a Java VM from terminating program

d) Daemon threads can not be grouped together

e) The JVM can terminate program when only daemon threads are running

answer: b, e? why e is correct?
 
Pranav Shukla
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Daemon threads exist only to serve User threads. Typically they will provide services to the User Threads and User Threads will do the real "work" in the program.

So if there doesn't exist any live User Thread, the JVM may choose to terminate the program even if there are daemon threads running.
 
Barry Gaunt
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can find out why e is correct by looking up the definition of a Daemon thread.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic