Mike Marchywka wrote:
>
> In the DayTime Server example I have, there appears to be a call
> to Thread.stop() ( on page 301 in Hunter/Crawford)to stop the
> daemon thread. Is this accepted procedure or is there a more recent
> edition?
>

 Thread.stop() has been deprecated for a while now,
refer to the java.lang.Thread.stop() javadocs for
further details. Thread.interrupt() requires that
the interrupted thread be specially written to notice
the interrupt. Check the references in my previous
posts in this thread, especially the 'Cancellation'
article by Doug Lea, and the reference to the 1.4
javadocs.

 Java does not provide a generic way to stop a Thread,
the argument being that any possible cure is worse
than the disease.


> It doesn't look like there is really anything more dangerous about
> launching a thread from a servlet than from anything else
>

 The main difference is that (presumably) a servlet is
running inside a long-running servlet-container. So if
your servlet is eating threads, eventually it's going
to eat them all. Then, depending on how well your servlet
container is written, the whole container or maybe just
your servlet will stop working. In some circles, that
sort of thing is considered embarrassing.

 If you've read the Doug Lea article, and your response
was to nod your head and mumble 'well, of course, that's
all obvious', then never mind, you understand the issues
well enough to make the safety-vs-convenience judgement on
your own. If you read the article and thought to yourself
'This guy is crazy, it can't really be all that hard', then
you need to re-read the article.


--
Christopher St. John [EMAIL PROTECTED]
DistribuTopia http://www.distributopia.com

___________________________________________________________________________
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