Hi Alex, Thanks for your answer. Here are some more details : - Assume I can't change the code to check for cancels (which I agree is the best way to do it !), - The thread that I want to kill spawns a process in another JVM (that's the Ant java task) and when I call stop() on the thread that started this other JVM, it does not stop this other JVM
I have come to the conclusion that there is no simple way to do it ... But if anyone has a clue ... :) Thanks. Vincent. ----- Original Message ----- From: "Rosen, Alex" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, February 22, 2001 5:20 PM Subject: RE: Stopping/Killing a task ? > I'm not too clear on what you're trying to do, but there's an excerpt from Doug > Lea's book that might help: http://gee.cs.oswego.edu/dl/cpj/cancel.html > > Here's my take on cancellation: If you're the one writing the code that needs > to be cancelled, you should use the periodically-check-for-cancel mechanism he > suggests. If not, you can't, so Thread.stop() is the only alternative. I think > the only problem with calling stop() is that the objects used by that thread > might be left in an inconsistent state. However, if you're planning on throwing > those objects away anyway, it seems like this should be a safe operation. > > --Alex > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > >
