aspose file tools *
The moose likes Threads and Synchronization and the fly likes Daemon thread Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Threads and Synchronization
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: 18671
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