I really like your tutorial but I don't think it's good enough to kill threads that you don't want anymore. As far as I know .interrupt() only works for threads that are sleeping.
Example:
if you use a while(true){} loop and you apply interrupt it wouldn't work. I'm just looking for a Thread.stop() replacement.
Nevertheless thank you for your post.
Very good article my friend, but the .interrupt() doesn't work very well when you have a IO operation on the run() method. Somehow the VM seems to wait for the IO operation to end and keep the thread on memory for a while. This can couse terible JVMMemoryOverflow problems.
But thaks again for this material, I loved.
Best regards.
Interesting but not enoughDissident September 9, 2011 at 9:03 PM
I really like your tutorial but I don't think it's good enough to kill threads that you don't want anymore. As far as I know .interrupt() only works for threads that are sleeping. Example: if you use a while(true){} loop and you apply interrupt it wouldn't work. I'm just looking for a Thread.stop() replacement. Nevertheless thank you for your post.
Socket + ThreadsTiago Rosolen October 21, 2011 at 11:35 PM
Very good article my friend, but the .interrupt() doesn't work very well when you have a IO operation on the run() method. Somehow the VM seems to wait for the IO operation to end and keep the thread on memory for a while. This can couse terible JVMMemoryOverflow problems. But thaks again for this material, I loved. Best regards.
finally !Chirag October 18, 2012 at 5:06 PM
Why not use "try" with "finally" instead of catching and rethrowing exception to clean up the stuff while exiting
DpaMhVCcjOCathleen June 13, 2013 at 3:10 AM
Tocuhdown! That's a really cool way of putting it!
Post your Comment