Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

thread dies?  RSS feed

 
Robert Kennedy
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if the thread which creates a thread is terminated are the threads which the terminated thread created also terminated?

for example an applet creates a thread and then the user navigates away from the page causing the applet destry method to execute.
 
Edward Harned
Ranch Hand
Posts: 291
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you set daemon to true when you create the thread -- when there are no other threads alive, then the JVM dies killing all daemon threads.

When not daemon, then the thread continues until you kill the JVM.
 
Henry Wong
author
Sheriff
Posts: 23283
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Robert Kennedy:
if the thread which creates a thread is terminated are the threads which the terminated thread created also terminated?


No
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!