Daemon threads are threads that aren't as 'important' as other threads
(their existence isn't enough to keep the process around).  Although they
have obvious uses when writing a Java Application, I don't think a daemon
thread is  treate any differantly from a 'normal' thread when created by a
servlet.

>From the documentation on the java.lang.Thread class:
When a Java Virtual Machine starts up, there is usually a single non-daemon
thread (which typically calls the method named main of some designated
class). The Java Virtual Machine continues to execute threads until either
of the following occurs:
   The exit method of class Runtime has been called and the security manager
has permitted the exit operation to take place.
   All threads that are not daemon threads have died, either by returning
from the call to the run method or by throwing an exception that propagates
beyond the run method.

-----Original Message-----
From: Jon Wilmoth [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 21, 1999 3:02 PM
To: [EMAIL PROTECTED]
Subject: Re: daemon thread


May I ask what the difference between a daemon thread and a regular thread
are?

----- Original Message -----
From: Chris Gow <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, July 21, 1999 2:16 PM
Subject: Re: daemon thread


> > Hi!
> >
> > I want to implement a daemon thread that is still alive after the
> > program exits. Is that possible? I was told that when only daemon
> > threads remain in a program, JVM exits. Does that mean the daemon
> > threads also exit?
> >
>         Correct.
>
> > I want to use a daemon thread to do some background control, for
> > example, if a servlet session has idled for 20 minutes, the daemon
> > thread will invalidate this session.
> >
>         You won't need a deamon thread to watch for invalid sessions, a
> normal Java thread will do the job just fine.
>
>         Chris Gow
>         [EMAIL PROTECTED]
> >
__________________________________________________________________________
> > _
> > To unsubscribe, send email to [EMAIL PROTECTED] and include in the
> > body
> > of the message "signoff SERVLET-INTEREST".
> >
> > Archives: http://archives.java.sun.com/archives/servlet-interest.html
> > Resources: http://java.sun.com/products/servlet/external-resources.html
> > LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
>
___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to