Questions tagged [stm]

Software Transactional Memory

Software transactional memory (STM) is a concurrency control mechanism analogous to database transactions for controlling access to shared memory in concurrent computing. It is an alternative to lock-based synchronization.

Summary taken from Wikipedia

3 questions
26
votes
3 answers

Why do some functional languages need software transactional memory?

Functional languages, by definition, should not maintain state variables. Why, then, do Haskell, Clojure, and others provide software transactional memory (STM) implementations? Is there a conflict between two approaches?
Michael Spector
  • 363
  • 2
  • 5
11
votes
1 answer

Composability Example of Software Transactional Memory

One of the major advantages of software transactional memory that always gets mentioned is composability and modularity. Different fragments can be combined to produce larger components. In lock-based programs, this is often not the case. I am…
dbyrne
  • 1,378
  • 1
  • 11
  • 15
9
votes
1 answer

Accessing the history of a `ref` in Clojure

The documentation for ref shows a :max-history option and states that "refs accumulate history dynamically as needed to deal with read demands." I can see that there is history at the REPL, but I don't see how to find previous values of a…
GlenPeterson
  • 14,890
  • 6
  • 47
  • 75