• Post Reply Bookmark Topic Watch Topic
  • New Topic

the main thread and 'other' ones.  RSS feed

 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm just confirming something with y'all.

If I have something like:
the 'main' thread will conclude very swiftly, but the JVM will not exit (and so my program will still be 'running'), because of the thread started by MyThreadedClass. Or does the 'main' thread hang around until something finally kills the _me thread ?
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The main thread will end, but the JVM won't exit until all non-daemon threads have ended.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!