[Deploying Sakai] killing threads

Charles Hedrick hedrick at rutgers.edu
Wed Oct 28 19:20:36 PDT 2009


>> however Thread.stop() is considered unsafe:
>
>  http://stackoverflow.com/questions/1102094/killing-thread-instantly-in-java
>
> and even Sun's own disclaimer:
>
>  http://java.sun.com/j2se/1.5.0/docs/guide/misc/threadPrimitiveDeprecation.html
>
> which is why I've never even attempted it...

I read that. However the alternative is to leave the thread in the  
loop. The inconsistency is still there. In addition, the looping  
thread could have some critical data structure locked. In that case  
the JVM (or perhaps one user or one test, etc) could be unusable. I've  
never actually seen that in one of these looping situations. There's  
no really safe alternative other than restarting the JVM, and even  
that could leave the database in an inconsistent state. You pays your  
money and takes your choice.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://collab.sakaiproject.org/pipermail/production/attachments/20091028/5eaef1e2/attachment.html 


More information about the production mailing list