On 8/11/06, Jason Orendorff <[EMAIL PROTECTED]> wrote:
> On 8/11/06, Josiah Carlson <[EMAIL PROTECTED]> wrote:
> > Slawomir Nowaczyk <[EMAIL PROTECTED]> wrote:
> > > But it should not be done lightly and never when the code is not
> > > specifically expecting it.
> >
> > If you don't want random exceptions being raised in your threads, then
> > don't use this method that is capable of raising exceptions somewhat
> > randomly.
>
> I agree.  The only question is how dire the warnings should be.
>
> I'll answer that question with another question:  Are we going to make
> the standard library robust against asynchronous exceptions?  For
> example, class Thread has an attribute __stopped that is set using
> code similar to the example code I posted.  An exception at just the
> wrong time would kill the thread while leaving __stopped == False.
>
> Maybe that particular case is worth fixing, but to find and fix them
> all?  Better to put strong warnings on this one method: may cause
> unpredictable brokenness.

That is a rather special case since this code (unlike most stdlib
code) can assume it won't get asynchronous exceptions like
KeyboardInterrupt, since that can't be raised in threads.

I expect that the unpredictable brokenness is even bigger in most user
code -- *most* people can't write threadsafe code if their life
depended on it. I believe the only exception I know is Tim Peters.

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)
_______________________________________________
Python-3000 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to