Difference between revisions of "Software transactional memory"

From HaskellWiki
Jump to navigation Jump to search
(fixed link)
m (Fix broken beautiful concurrency link)
 
(15 intermediate revisions by 9 users not shown)
Line 6: Line 6:
   
 
== Resources ==
 
== Resources ==
  +
  +
* [https://www.microsoft.com/en-us/research/publication/beautiful-concurrency/ Beautiful Concurrency] - a chapter from the book Beautiful Code
   
 
* [[Research_papers/Parallelism_and_concurrency#Lock_free_data_structures_and_transactional_memory|Research Papers on STM]]
 
* [[Research_papers/Parallelism_and_concurrency#Lock_free_data_structures_and_transactional_memory|Research Papers on STM]]
   
* [http://www.haskell.org/ghc/docs/latest/html/libraries/stm/Control-Concurrent-STM.html Documentation for the Control.Concurrent.STM module in GHC]
+
* [http://www.haskell.org/ghc/docs/latest/html/libraries/base/GHC-Conc.html Documentation for the Control.Concurrent.STM primitives GHC]
   
  +
* [http://hackage.haskell.org/packages/archive/stm/2.2.0.1/doc/html/Control-Concurrent-STM.html Documentation for the Control.Concurrent.STM module in GHC]
== Projects using STM, and example code ==
 
   
  +
* [http://channel9.msdn.com/Showpost.aspx?postid=231495 Programming in the Age of Concurrency: Software Transactional Memory] - interview of Simon Peyton-Jones and Tim Harris.
* [http://darcs.haskell.org/~lemmih/conjure/ Conjure] (a bittorrent client) is using STM quite heavily.
 
   
 
== Projects using STM ==
* The HAppS MACID monad runs on top of STM. It is open source and available via darcs at http://happs.org. http://Pass.net is a production application that uses this infrastructure.
 
   
  +
As of April 2011, there were more than 200 projects on Hackage with dependencies on GHC's STM implementation, including:
* [http://www.eecs.tufts.edu/~rdocki01/shellac.html Shellac] is a framework for building read-eval-print style shells. It uses STM, but in a pretty limited way.
 
  +
 
* [http://hackage.haskell.org/package/conjure Conjure] (a bittorrent client) is using STM quite heavily.
  +
 
* [http://www.cs.princeton.edu/~rdockins/shellac/home Shellac] is a framework for building read-eval-print style shells. It uses STM, but in a pretty limited way.
   
 
* [http://www.pugscode.org 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.
 
* [http://www.pugscode.org 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.
   
  +
* [http://happstack.com/ Happstack], a web framework
[[Category:Language]]
 
  +
  +
* [http://hackage.haskell.org/package/TCache TCache], a transactional cache with configurable persitence.
  +
  +
* [http://hackage.haskell.org/package/Barracuda Barracuda], An ad-hoc chat program
  +
  +
* [http://hackage.haskell.org/package/Combinatorrent Combinatorrent], a BitTorrent client, based on STM for concurrency
  +
  +
* [http://hackage.haskell.org/package/Scurry Scurry], P2P VPN implementation.
  +
  +
== Examples ==
  +
  +
* [[Simple STM example]]
  +
  +
* [[Concurrency_demos/Graceful_exit#Using_STM|Graceful exit]]
  +
  +
* [[New_monads/MonadAdvSTM#Single_Threaded_Code|Advanced STM Monad]]
  +
  +
* [http://computationalthoughts.blogspot.com/2008/03/some-examples-of-software-transactional.html Blog: Some examples of Software Transactional Memory in Haskell]
  +
  +
* Examples from this wiki: Search for "concurrent.stm" at the top of this page.
  +
 
[[Category:Language extensions]]

Latest revision as of 11:56, 15 March 2024

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.

Resources

Projects using STM

As of April 2011, there were more than 200 projects on Hackage with dependencies on GHC's STM implementation, including:

  • Conjure (a bittorrent client) is using STM quite heavily.
  • 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.
  • TCache, a transactional cache with configurable persitence.
  • Scurry, P2P VPN implementation.

Examples

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