[pypy-dev] STM

Armin Rigo arigo at tunes.org
Fri Jan 6 17:04:16 CET 2012

Hi David,

On Fri, Jan 6, 2012 at 15:49, David Edelsohn <dje.gcc at gmail.com> wrote:
> 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.

Just for the sake of the argument:  This seems wrong to me.  You could
declare C functions with an attribute meaning "this function is meant
to be called in a transaction, but it may end the transaction and
start the next one".  Or something more general along the lines of
"this function may return after activating a new transaction".  When
seeing a call to such a function, the callee must be ready to handle
that case.  Either it end the transaction explicitly, or it must
itself be marked with the same attribute to allow the new transaction
to be propagated further up.

This might complicate a lot the code in gcc, for all I know; and right
now it looks like it's not needed here, after all.

A bientôt,


More information about the pypy-dev mailing list