| Author |
Garbage Collector
|
chintan shah
Greenhorn
Joined: Oct 05, 2008
Posts: 7
|
|
can a daemon thread outlive the main thread that created and turned it to daemon? Also, It is said that garbage collector is a daemon thread used by JVM. can anyone tell where and when it is spawned?
|
 |
Ernest Friedman-Hill
author and iconoclast
Marshal
Joined: Jul 08, 2003
Posts: 24041
|
|
Yes, daemon threads can live longer than the thread that created them, as long as there is at least one other non-daemon thread in the JVM. There's no special link between the daemon thread and its creator. The garbage collector thread, along with several other special-purpose threads, are all created when the JVM starts up, before any of your code is invoked.
|
[Jess in Action][AskingGoodQuestions]
|
 |
 |
|
|
subject: Garbage Collector
|
|
|