On Fri, 13 Nov 1998 15:15:29 +0000, [EMAIL PROTECTED] wrote:
> I read somewhere that Thread.stop() is now deprecated. Now how on
> earth do we stop a thread ?
> I thought the solution would be Thread.interrupt()
> but that only works when the thread is sleeping, at least in JDK 1.1
> documentation.
>
> I do not have the JDK 1.2 to hand, and I have started use multiple
> threads in Swing/JFC/. It seems to be idiocy to have a start method
> and not have a stop method. The stop() method justs halts the thread
> object and the garbage collector collects any rubbish.
>
> Thoughts?
There are reasons for some of the thread changes, mainly that the JVM
can not control the threads as well on native threading systems (even
more so when the thread is maybe running on another CPU) There would
be far too much overhead in normal operation.
You can implement your own thread operations but you would then need to
have the overhead only in those cases. (It also will have the same
problems with multi-processor/native thread operations and the like
but if you really want a harsh stop(), it may be the only way)
I too like the feature but it is easy enough to have your own notification.
A harsh stop may not be able to control what is happening at the moment or
it would have to only check at certain points within the operations.
Michael Sinz -- Director of Research & Development, NextBus Inc.
mailto:[EMAIL PROTECTED] --------- http://www.nextbus.com
My place on the web ---> http://www.users.fast.net/~michael_sinz