Video

Get the Flash Player to see this video.

For the best quality, click on the zoom button in the right corner.

You can also try the high quality version, or download the mp4 version.

Presentation slides (pdf).
 

CCSTM: A Library-Based STM for Scala
Nathan Bronson, Hassan Chafi, Kunle Olukotun

We introduce CCSTM, a library-only software transactional memory (STM) for Scala, and give an overview of its design and implementation. Our design philosophy is that CCSTM should be a useful tool for the parallel programmer, rather than a parallelization mechanism for arbitrary sequential code. This frees us from the semantic tar pits that surround privatization, strong isolation, and irrevocable system calls. It also allows us to express the STM using Scala classes and methods, a design choice that has far-reaching consequences. Transactional accesses in CCSTM are performed through instances that implement a trait Ref. These transactional references may be long-lived, or may be transient accessors to bulk transactional data such as an array. The syntax for dereferencing Ref instances is a pain point for the library-based approach, but the reference-based interface also provides benefits. Ref serves as a first-class representation of a transactionally-managed memory location, providing a natural way to express additional STM features such as conditional waiting, non-transactional compare-and-swap, manually-validated reads, and deferrable transformation using pure functions.
In an additional departure from typical STM designs, CCSTM passes the current transactional context through an implicit parameter, rather than dynamically binding the transaction to the current thread. This static transaction scoping allows CCSTM to compete in performance with an STM that performs bytecode rewriting, but it hinders composability. We sketch a potential solution to this problem that combines static scoping for barriers and dynamic scoping for nested transactions.