[pypy-dev] STM

David Edelsohn dje.gcc at gmail.com
Fri Jan 6 21:21:11 CET 2012


On Fri, Jan 6, 2012 at 11:04 AM, Armin Rigo <arigo at tunes.org> wrote:

> 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.

Yes, I agree that the feature you suggest would be useful.  I am
trying to point out the complexity of implementing such a feature in a
static compiler.

If one uses translation unit to a single source file and the functions
are declared "static" -- in the C Language meaning -- then the
compiler can track the operations.  If the function is external and
visible, then it is extremely complicated for the static compiler to
create an infrastructure to observe the operations in the transaction
for the arbitrary code paths that can intervene.

- David


More information about the pypy-dev mailing list