Hi,

thread.setDaemon(true) would not solve this problem. What this method does
is that it tells the VM that this thread a sort of support service and it
does not need to keep running for this thread. So when you have no more
NonDaemon thread running, you may exit. So you may have any no. of Daemon
threads running, but if all the threads which are NonDaemon have died down
( including the thread running the main), the VM will exit.

of course you decide if a thread is going to be a daemon before you start
the thread. i.e. you call the method thread.setDaemon() before
Thread.start().

regds,
Gokul


----- Original Message -----
From: "Harry Hendrata" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, September 13, 2000 8:32 PM
Subject: Re: [SERVLET-INTEREST] To all the java Gurus...BackGround Process


> does thread.setDaemon(true) would solve this problem?
>
>
> -----Original Message-----
> From: A mailing list for discussion about Sun Microsystem's Java Servlet
> API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of Purav
> Sent: Wednesday, September 13, 2000 7:53 PM
> To: [EMAIL PROTECTED]
> Subject: Re: To all the java Gurus...BackGround Process
>
>
> What yuo are saying is what i guessed. but then  whats the solution
>
>
>
> BR
> Purav
>
> -----Original Message-----
> From: A mailing list for discussion about Sun Microsystem's Java Servlet
> API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of Gokul
> Singh
> Sent: Wednesday, September 13, 2000 2:18 PM
> To: [EMAIL PROTECTED]
> Subject: Re: To all the java Gurus...BackGround Process
>
>
> Hi,
>
> I think you can not acheive this. You can not return to the command prompt
> ( without using the OS facilities) untill the JVM exits. Now the JVM will
> not exit till there are non Daemon threads running. If you use
> System.exit(), you exit the JVM and so there is no question of any more
> threads running as there is no JVM running to support these threads.
>
> I would love to know if I am wrong here.
>
> Regds,
> Gokul ( Pl. see I am no Guru..)
>
> ----- Original Message -----
> From: "Purav" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, September 13, 2000 5:30 PM
> Subject: [SERVLET-INTEREST] To all the java Gurus...BackGround Process
>
>
> > This question is to all the Java Gurus.
> >
> > How do i run a  java class as a background process.
> > I mean when i type "java test", the control should return to the dos or
> > Linux prompt with the program running in background
> > I know In linux , i can acheive this by putting an & at the end.
> >
> > But how do you acheive this throught code
> >
> > I have tried various things like calling a thread from the Main class
and
> > then write system.exit. but it doesnot work
> >
> > Any body knows how this can be acheived
> >
> >
> > Purav
> >
> >
>
___________________________________________________________________________
> > 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
>

___________________________________________________________________________
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