The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
November 2000



This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.


daemon threads

Posted by l.srinivasan on December 27, 2000 at 6:20 AM

> I dont know about this Daemon threads give any
> practicle example in real life where we use it.

> plz..any who know send me details

Threads that work in the background to support the runtime environment are called daemon threads. For example, the clock handler thread, the idle thread, the garbage collector thread, the screen updater thread, and the garbage collector thread are all daemon threads. The virtual machine exits whenever all non-daemon threads have completed.

public final void setDaemon(boolean isDaemon)
public final boolean isDaemon()

By default a thread you create is not a daemon thread. However you can use the setDaemon(true) method to turn it into one.


Sponsored Links

Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us