Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

daemon thread & user thread

 
Gokulakrishnan Raghuraman
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is the garbage collection thread a non-daemon thread ? and can the garbage collection thread outlive the last user thread ?
Thanx
 
Jessica Sant
Sheriff
Posts: 4313
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok.... lets look at this objectively.
* by definition the JVM won't shut down til all user (non-daemon) threads finish executing.
so.... if the garbage collector is a user thread -- how would the JVM ever shut down?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic