[vox-tech] Java Threads: Abort not found...

Bill Broadley vox-tech@lists.lugod.org
Sat, 19 Apr 2003 13:29:41 -0700


On Fri, Apr 18, 2003 at 06:44:45PM -0400, Mike Simons wrote:
>   All true.
>   
>   I'm irritated about Java preventing one thread of forcefully stopping 
> another thread... If you start a child thread that makes a blocking call
> into something, there doesn't appear to be a way for the parent thread 
> to decide the child has taken too long and forcefully abort the child 
> thread, or even get it to return from that blocked call.

Er, do you have a simple example to demonstrate this? 

>   In all Java code I've seen that handles this situation the parent
> just ignores the stuck child and continues along while the child is
> left in limbo land if it ever returns the result will be ignored...
> eventually the Java process exhausts resources on all the stuck
> children threads.

Er, well there's stop and threadDeath, and destroy.  Thread.join()
takes a timer so you can wait for a thread to return for a period of
time then take other actions.

Don't forget a thread is an object and objects without reference get
garbage collected.



-- 
Bill Broadley
Mathematics
UC Davis