Modular transactional memory
Software transactional memory has the potential to greatly simplify development of concurrent software, by supporting safe composition of concurrent shared-state abstractions. However, STM semantics are de-fined in terms of low-level reads and writes on individ-ual memory locations, so implementations are unable to take advantage of the properties of user-defined ab-stractions. Consequently, the performance of trans-actions over some structures can be disappointing. We present Modular Transactional Memory, our framework which allows programmers to extend STM with concurrency control algorithms tailored to the data structures they use in concurrent programs. We describe our implementation in Concurrent Haskell, and two example structures: a finite map which al-lows concurrent transactions to operate on disjoint sets of keys, and a non-deterministic channel which supports concurrent…