[pypy-dev] [pypy-svn] r27660 - in pypy/branch/njriley-trans/pypy: rpython/lltypesystem translator/c

Nicholas Riley njriley at uiuc.edu
Wed May 24 23:39:38 CEST 2006


On Wed, May 24, 2006 at 10:21:08PM +0100, Michael Hudson wrote:
> njriley at codespeak.net writes:
> 
> > Author: njriley
> > Date: Wed May 24 20:48:13 2006
> > New Revision: 27660
> >
> > Modified:
> >    pypy/branch/njriley-trans/pypy/rpython/lltypesystem/rclass.py
> >    pypy/branch/njriley-trans/pypy/translator/c/exceptiontransform.py
> >    pypy/branch/njriley-trans/pypy/translator/c/node.py
> > Log:
> > Make exceptions thread-local
> 
> Would this change make sense on the trunk too?

Assuming the GIL model, I don't see anywhere that the exception state
gets swapped on a thread switch now; so, if this is the case, then
yes, they'd make sense.  With actual concurrent execution as I'm
doing, that wouldn't help, of course.

My changes would be fine if we could expect __thread (or some
equivalent compiler-managed TLS) to be available everywhere, but PyPy
doesn't make that assumption (see Samuele's work, e.g.
pypy.translator.tool.cbuild.check_under_under_thread).

The work I did for the old, pre-exceptiontransform model used pthread
thread-specific variables, which would be possible as an alternative,
but it'd take some work to automatically generate, and it'd impose
considerably higher overhead on exception accesses.

-- 
Nicholas Riley <njriley at uiuc.edu> | <http://www.uiuc.edu/ph/www/njriley>



More information about the Pypy-dev mailing list