Why You Should Use Software Transactional Memory
summary
Argues that Haskell’s STM actually reduces concurrency footguns by giving concrete semantics: use atomically with TVars and newTVarIO to avoid nested transactions, rely on retry/check for blocking (no spinning), and compose higher structures. Workshop builds a TMVar from TVar that passes tests, wires a TBMQ with 8 workers and a 16-slot filler for a 1,000-item run, fixes a 100,000-replica race by coalescing atomically, and shows the runtime can surface deadlocks as a deadlock detected by runtime async exception.
AI-written summary · about
chapters (13)
- 0:00Start
- 3:29Prerequisites
- 4:15Exercises Directory
- 6:35Material Mutable Variables
- 7:38Sharing Memory between Threads
- 15:40Exercise 2
- 31:55Was Stm First Invented in Haskell
- 38:18Race Condition
- 1:06:55Closable Channel
- 1:08:56Exercise 7
- 1:20:23Deadlocks
- 1:23:46Asynchronous Exceptions
- 1:24:36Global Variables
related talks
01h 00mWhat did C++ do for Transactional Memory?
01h 03m“Transactional Memory in Practice"
36mATOMICALLY { DELETE YOUR ACTORS }
01h 01mUnderstanding Hardware Transactional Memory
01h 13mTransactional memory
15mHTMFS: Strong Consistency Comes for Free with Hardware Transactional Memory...
27mOpen Transactional Actions: Interacting with non-transactional resources in S...
53mVariables in Haskell
