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 regarding 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 "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: 24057
    
  13

Moving to "Threads and Synchronization."


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

Joined: Jul 08, 2003
Posts: 24057
    
  13

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://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: regarding 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