This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Daemon Thread and Non-Daemon Thread Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "Daemon Thread and Non-Daemon Thread" Watch "Daemon Thread and Non-Daemon Thread" New topic
Author

Daemon Thread and Non-Daemon Thread

Saurabh Saha
Ranch Hand

Joined: Dec 08, 2004
Posts: 52
Hi All,
I want to know what is Daemon Thread and how it is different from
Non-Daemon Thread.

Thanks & Regards,
Vivek Mishra
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24081
    
  15

It's just a flag in the Thread object. The JVM will continue to run only as long as non-daemon threads exist. As soon as the only running threads have the daemon property set, the JVM will exit. That's it -- nothing more.


[Jess in Action][AskingGoodQuestions]
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Daemon Thread and Non-Daemon Thread
 
Similar Threads
finally code not executed
Daemon threads & non daemon Threads
Java Thread
Daemon Thread
threads!