Date and time:
Thursday, April 15, 2010 - 13:45 - 15:25
These are the papers will be presented during this session:
- 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.
- Lightweight language support for type-based, concurrent event processing
Philipp Haller
Many concurrent applications are structured around type-based event handling. Scala provides a library for event-based actors, which allows common idioms to be expressed in a concise and intuitive way. However, innocent-looking programs can exhibit catastrophic performance under certain conditions. In this paper, we introduce translucent functions, a type-based refinement of Scala's pattern-matching functions. Translucent functions additionally provide the run-time types of classes that identify disjoint cases in a pattern. We show how this additional type information can be used to optimize actors as well as a form of join-style synchronization.
- Data Parallel Programming in Scala
Bruce Lester
To more fully utilize the potential offered by multi-core processors, programming languages must have features for expressing parallelism. Data parallel programming features allow high-level collection-oriented operations to be easily expressed by the programmer, and then implemented by the runtime system in a parallel fashion for improved performance. This paper describes a data parallel class library, for the Scala language. This data parallel library includes a new type of data structure called a Parallel Vector, and fifteen basic operations on this data structure. The library and its implementation in Scala have several novel aspects including Where-Masks for conditional execution and vertical integration of data parallel operations in the runtime library implementation.