[pypy-dev] STM on CPython

exarkun at twistedmatrix.com exarkun at twistedmatrix.com
Fri Aug 26 18:57:51 CEST 2011


On 07:09 am, arigo at tunes.org wrote:
>Hi,
>
>A follow-up to the blog post about Software Transactional Memory (STM)
>at http://morepypy.blogspot.com/ .
>
>[snio[
>
>So, all this to say: 8 years later, I implemented that on CPython:
>https://bitbucket.org/arigo/cpython-withatomic/overview (on the 2.7
>branch).  It is sadly a fork of CPython instead of a C extension
>module because it needs to access and change a few things in ceval.c.
>The total patch is 190 lines, and that's because I need a new type
>(very verbose).  It implements "thread.atomic", which you use in a
>"with" statement.  So you write "with atomic:" and you get precisely
>the simple case described here:
>http://en.wikipedia.org/wiki/Software_transactional_memory#Proposed_language_support
>.
>
>Fwiw it's probably also a minimal patch to PyPy.  Sorry for being
>mostly off-topic for once...

Very cool.  Thanks for the summary.

Jean-Paul


More information about the pypy-dev mailing list