aspose file tools*
The moose likes Threads and Synchronization and the fly likes regarding 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 "regarding daemon thread" Watch "regarding daemon thread" New topic
Author

regarding daemon thread

Suseela doddi
Greenhorn

Joined: Jan 09, 2006
Posts: 13
why do set any thread as daemon thread and wats use of that.
thanks in advance.

regards
chandu
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34

Moving to "Threads and Synchronization."


[Jess in Action][AskingGoodQuestions]
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34

The JVM will exit when all the threads that remain running are daemon threads. Therefore, if you want to create a Thread that runs as a sort of background task, and you don't want the program to continue running if your main thread terminates but the background task remains, then you should make that background thread a daemon thread.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: regarding daemon thread