On Thu, 15 Mar 2007 09:41:31 -0500, [EMAIL PROTECTED] wrote: > > >> I just proposed to implement thread cancellation for the SoC. Is > >> there any prior work where one could start? > > Jean-Paul> The outcome of some prior work, at least: > > Jean-Paul> > http://java.sun.com/j2se/1.4.2/docs/guide/misc/threadPrimitiveDeprecation.html > >I responded to that. I got the impression reading that page that the killed >thread doesn't regain control so it can't clean up its potentially >inconsistent data structures.
The second question on the page: Couldn't I just catch the ThreadDeath exception and fix the damaged object? Addresses this. >I inferred from Martin's proposal that he >expected the thread to be able to catch the exception. Perhaps he can >elaborate on what cleanup actions the dying thread will be allowed to >perform. Perhaps he can. Hopefully, he can specifically address these points: 1. A thread can throw a ThreadDeath exception almost anywhere. All synchronized methods and blocks would have to be studied in great detail, with this in mind. 2. A thread can throw a second ThreadDeath exception while cleaning up from the first (in the catch or finally clause). Cleanup would have to repeated till it succeeded. The code to ensure this would be quite complex. Jean-Paul _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com