Hi Armin:
________________________________
From: Armin Rigo <[email protected]>
To: Andrew Francis <[email protected]>
Cc: Py Py Developer Mailing List <[email protected]>
Sent: Monday, January 30, 2012 3:46 PM
Subject: Re: [pypy-dev] Question about the STM module and RSTM
>You wouldn't be able to write pure Python versions of classical STM
>examples, because the "transaction" module works at a level different
>from most STM implementations. You can try to write RPython versions
>of them, just for fun, but they may break at a moment's notice.
I would still be interested in writing RPython and Stackless versions.
>In PyPy, we look at STM like we would look at the GC. It may be
>replaced in a week by a different one, but for the "end user" writing
>pure Python code, it essentially doesn't make a difference. That's
>why we have no plan at all to let the user access all the details of
>the STM library. Even the fact that STM is used is almost an
>implementation detail, which has just a few visible consequences
>(similar to how the very old versions of Python had a GC based on
>refcounting alone, which didn't free loops).
Perhaps one reason you would want to exposure the STM module is for other
language
implementations that could use STM? An example. My interest in Stackless Python
and PyPy
(via stackless.py) came out of wanting to develop a WS-BPEL processor. My
initial approach was
to write a WS-BPEL to Python pre-processor. PyPy would allow me to write a
WS-BPEL processor
in ways I couldn't imagine a few years ago. I'm on the fence about WS-BPEL
these days.
As for your approach. Like a lot of people on the blog, it is not the way I
understood STM to work. For me this is because Haskell is the only approach
I've seen. Reading papers has exposed me to more ideas.
I have been reading the text "Transactional Memory, 2nd (2010)" by Harris,
Larus, and Rajawar. In one of the sections, they describe an approach called
"Transactions Everywhere." Assumption is that transactions are the norm, not
the exception. So atomicity is the default.
Connected to that is TM based on Automatic Mutual Exclusion (or AME). Roughly,
AME is a cooperative multi-threading system that is build over STM. Perhaps
this is helpful, you can read the paper "Automatic Mutual Exclusion"
(http://research.microsoft.com/en-us/projects/ame/automutex-hotos.pdf) or look
at other papers at the site.
Salut,
Andrew
_______________________________________________
pypy-dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-dev