[erlang-questions] STM

Richard O'Keefe ok@REDACTED
Thu Mar 5 23:04:54 CET 2009


On 5 Mar 2009, at 9:07 pm, Joe Armstrong wrote:
> I actually think TMs are a bad idea - it's still shared state - and if
> the TM fails
> then everything gets screwed up.

Long-term readers of this mailing list may recall that having
read the "Beautiful Concurrency" paper, demonstrating STM in
Haskell, I said "that's the very opposite of beautiful" and
showed that you could do it much more clearly in Erlang.

There's a paper
     The Transactional Memory/Garbage Collection Analogy
     Dan Grossman, OOPSLA'07.

It's an interesting and balanced paper.  For one thing, he makes
the point that message passing is an alternative, but *IF* you
want to program with shared memory, transactional memory helps.
I particularly like this bit:

	it will lead us to the balanced and obvious-once-you-
	say-it conclusion that
	    transactions make it easy to define critical sections
             (which is a huge help in writing and maintaining
              shared-memory programs)
         but
	    provide no help in identifying where a critical
	    section should begin or end (which remains an
	    enormous challenge).

That's the single most helpful thing I've ever read about TM.





More information about the erlang-questions mailing list