sending thread exceptions (was Re: RELEASED Python 2.3.1)

Peter Hansen peter at engcorp.com
Wed Sep 24 17:31:20 EDT 2003


Peter Hansen wrote:
> 
> > Peter Hansen <peter at engcorp.com> wrote re:
> > > PyThreadState_SetAsyncEnc
> Is this function available in a DLL somewhere?  I can't find even
> a single reference to that name anywhere in the Python23 directory
> tree on Win32 after a fresh install.

Skip that question....of course, python23.dll goes into c:\windows\system
so it wasn't where I was searching...

I'd still be very interested in examples of use through ctypes (with
which I'm not yet familiar).

Alex' slides were interesting, but I think they might reflect a subtle
trend away from Python's traditional treatment of programmers as
consenting adults, with all the concern about newbies and the hints
that such a dangerous feature will be abused to no end.

The slides also suggest that there are almost no use cases whatsoever 
for such a feature, though admitting there might, just barely, be enough
to merit adding it as a non-newbie C-only API which one has to jump
through hoops (or use ctypes :-) to access.  

I can think of several use cases right off the top of my head, one 
of them being while running automated unit and acceptance tests, 
to ensure that a test involving threads will complete (generally 
with a failure in this case) even if the code is broken and the 
thread cannot be terminated.

-Peter




More information about the Python-list mailing list