The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
November 2000

Advertisement

Advertisement

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.

Message:

hema and ruchi this defenation from good java books

Posted by ketul(ruchi_ketul) on November 09, 2000 at 11:18 AM

if u can clear yr problem by this.

A daemon thread is a thread that runs for the benefit of other threads.Daemon threads run in background(i.e when processor time is available that would otherwise go to waste).Unlike conventional user threads,daemon threads do not prevent a program from terminating.The garbage collector is a daemon threads.Non daemon threads are conventional user threads.We designate a thread as a daemon with the method call

setDaemon(true);

A false argument means that the thread is not a daemon thread.aprogram can include a mixture of daemon threads and non-daemon threads.when only daemon threads remain in a program, The program exits.if a thread is to be a daemon,it must be set as such before it's start method is called or an IllegalThreadStateException is thrown.method isDaemon returns true is a daemon thread and false otherwise.




Replies:

Sponsored Links



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