The there are many different approaches to STM. It's a very broad topic like "type systems": one approach can easily succeed while other approaches fail for various different reasons.
Clojure's STM has a few design decisions that make it IMHO more practical and effective than previous approaches:
- It doesn't try to protect arbitrary data with STM - you have to use special managed references like (
ref
and similar). This makes it a much simpler and more focused design than many earlier STM approaches (this includes Microsoft's approach, at least as described in the above-linked article)
- It uses multi-version concurrency control with immutable data. This makes transaction handling much more effective and practical. In particular, it means that non-transactional reads don't require any locking, which is a huge performance win....
- It's done in the context of a functional language - in particular, the fact that most code in Clojure is side-effect free by default makes it much easier to apply such techniques like transaction retries.
As a result of these design decisions, Clojure's STM is a very different beast from previous STM approaches, and I think succeeds because of its novel design. The video below is a bit old but excellent if you want an overview of how it works:
http://www.infoq.com/presentations/Value-Identity-State-Rich-Hickey