<Swing Dev> Ways to cancel SwingWorker running task

ximalaya ims3g at 126.com
Wed Jul 13 23:41:11 UTC 2011


Hi Mario,
Thanks for your suggestion!
After running some tests with JDK6.0, I find Thread.stop can terminate the thread even if it's uninterruptible(ThreadDeath exception on the running thread stack). Seems some statements in the article are obsolete now?

Thanks and Best Regards,
Xmly


At 2011-07-13 14:10:48,"neugens.limasoftware"<neugens.limasoftware at gmail.com> wrote:
I fear you may have an architectural problem here.

You probably just need to wrap the library you are using into a more high level one that can deal with interruption.

Thread.stop is a bad idea in general, beside, it will not help if the library itself for some reason tries to be "uninterruptible".

Please, refer to this very good page for more information:

http://download.oracle.com/javase/1.4.2/docs/guide/misc/threadPrimitiveDeprecation.html

The article that Roman posted is also one of my favourite on the subject.

Cheers,
Mario
--
Sent from HTC Desire...

pgp key:http://subkeys.pgp.net/ PGP Key ID: 80F240CF
Fingerprint: BA39 9666 94EC 8B73 27FA  FC7C 4086 63E3 80F2 40CF

http://www.icedrobot.org

Proud GNU Classpath developer:http://www.classpath.org/
Read About us at:http://planet.classpath.org
OpenJDK:http://openjdk.java.net/projects/caciocavallo/

Please, support open standards:
http://endsoftpatents.org/


----- Reply message -----
Da: "ximalaya" <ims3g at 126.com>
Data: mer, lug 13, 2011 01:49
Oggetto: <Swing Dev> Ways to cancel SwingWorker running task
A: "Paulo Levi" <i30817 at gmail.com>
Cc: <swing-dev at openjdk.java.net>


Hi Paulo,
Thanks! Agree with you.
While sometimes we need to use 3rd party libraries which are out of our control...


Thanks,
Xmly
At 2011-07-13 07:36:22,"Paulo Levi" <i30817 at gmail.com> wrote:

Every task can be interruptible... if you check regularly. Even inputstreams can be interruptible if you have a wrapper bufferinputstream that checks for the interrupt status.




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/swing-dev/attachments/20110714/37792fb5/attachment.html>


More information about the swing-dev mailing list