This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Threads and Synchronization and the fly likes Daemon thread Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Threads and Synchronization
Reply Bookmark "Daemon thread" Watch "Daemon thread" New topic
Author

Daemon thread

muthu muruges
Ranch Hand

Joined: Feb 28, 2003
Posts: 70
Whether the daemon thread will be GCed if it comes out the run method provided the main thread keep on running?
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18670
Yes. Well as usualy, there are no guarantees regarding GC, and if you have saved a reference to the thread somewhere, you certainly my prevent GC. But in general, once a thread completes its run method it will be eligible for GC (unless there are other references somewhere). Being a daemon thread does not change this.


"I'm not back." - Bill Harding, Twister
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Daemon thread
 
Similar Threads
Daemon Thread
Daemon threads
how to generate a deamon thread in java
"Top Ten Topics that Everyone Thinks are on the SCJP Exam, but Aren't "- Bert Bates
Daemon Thread