This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach 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 | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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: 24183
    
  34

Moving to "Threads and Synchronization."


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

Joined: Jul 08, 2003
Posts: 24183
    
  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
 
Similar Threads
"Top Ten Topics that Everyone Thinks are on the SCJP Exam, but Aren't "- Bert Bates
Daemon Thread
how to generate a deamon thread in java
Daemon Thread
Daemon threads