blob: b60c21999bb3efafb35a419d39bce01e6c899a29 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
Software Transactional Memory
-----------------------------
GHC now supports a new way to coordinate the activities of Concurrent
Haskell threads, called Software Transactional Memory (STM). The `STM
papers <https://wiki.haskell.org/Research_papers/Parallelism_and_concurrency#Lock_free_data_structures_and_transactional_memory>`__
are an excellent introduction to what STM is, and how to use it.
The main library you need to use is the `stm
library <https://hackage.haskell.org/package/stm>`__. The main features
supported are these:
- Atomic blocks.
- Transactional variables.
- Operations for composing transactions: ``retry``, and ``orElse``.
- Data invariants.
All these features are described in the papers mentioned earlier.
|