[pypy-dev] STM
David Edelsohn
dje.gcc at gmail.com
Fri Jan 6 15:49:43 CET 2012
On Fri, Jan 6, 2012 at 9:23 AM, Armin Rigo <arigo at tunes.org> wrote:
> I agree, but my issue is precisely that (say) gcc 4.7, as far as I can
> tell, *imposes* the dynamic extent to be a nested block. There is no
> way to ask gcc to produce code handling the lower-level but more
> general alternative. It looks a bit like saying that the expected
> most common case is covered, but the general case is not; and, too
> bad, we really need the general case to turn CPython's GIL into
> transactions, so we can't even start experimenting at all.
Armin,
To some extent it is a convenience for the implementation, but STM
requires some way for the system to record the transaction that can be
committed or re-tried. Hardware or a hypervisor or an operating system
can observe and record an arbitrary sequence of operations. A
traditional static compiler cannot observe operations beyond the
boundary of the translation unit. And without something like
whole-program compilation to assert to the compiler that it has seen
the entire call graph, it cannot reach closure.
Lexical scoping seems necessary for STM in a traditional static
compiler without extensively retrofitting a way to record all
operations. On the other hand, PyPy's mechanism for generating its IR
from the interpreter implementation is a natural fit.
- David
More information about the pypy-dev
mailing list