Personal tools

Software transactional memory

From HaskellWiki

(Difference between revisions)
Jump to: navigation, search
(added SPJ and TH interview on Channel 9 forums)
Line 12: Line 12:
* [ Documentation for the Control.Concurrent.STM module in GHC]
* [ Documentation for the Control.Concurrent.STM module in GHC]
* [ Programming in the Age of Concurrency: Software Transactional Memory] - interview of Simon Peyton-Jones and Tim Harris.
== Projects using STM ==
== Projects using STM ==

Revision as of 21:01, 30 January 2007


1 Introduction

Software Transactional Memory, or STM, is an abstraction for concurrent communication. The main benefits of STM are composability and modularity. That is, using STM you can write concurrent abstractions that can be easily composed with any other abstraction built using STM, without exposing the details of how your abstraction ensures safety. This is typically not the case with other forms of concurrent communication, such as locks or MVars.

STM for Haskell was first implemented in GHC 6.4. There exist STM implementations for other compilers.

2 Resources

3 Projects using STM

  • Conjure (a bittorrent client) is using STM quite heavily.
  • The HAppS MACID monad runs on top of STM. It is open source and available via darcs at is a production application that uses this infrastructure.
  • Shellac is a framework for building read-eval-print style shells. It uses STM, but in a pretty limited way.
  • Pugs (an implementation of Perl 6 in Haskell) uses STM, and also exposes STM to the Perl 6 programmer via a similar interface to STM Haskell.

4 Examples

  • Examples from this wiki: Search for "concurrent.stm" at the top of this page.