[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pypy-dev
Subject:    Re: [pypy-dev] [pypy-svn] r27660 - in
From:       Nicholas Riley <njriley () uiuc ! edu>
Date:       2006-05-24 21:39:38
Message-ID: 20060524213938.GA7462 () uiuc ! edu
[Download RAW message or body]

On Wed, May 24, 2006 at 10:21:08PM +0100, Michael Hudson wrote:
> njriley@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@uiuc.edu> | <http://www.uiuc.edu/ph/www/njriley>

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic