Composability for Application-Specific Transactional Optimizations

Software Transactional Memory (STM) has made great advances towards acceptance into mainstream programming by promising a programming model that significantly reduces the complexity of writing concurrent programs. Unfortunately, the mechanisms in current STM implementations that enforce the fundamental properties of transactions — atomicity, consistency, and isolation — also introduce considerable performance overhead. This performance impact can be so significant that in practice, programmers are tempted to leverage their knowledge of a specific application to carefully bypass STM calls and instead access shared memory directly. While this technique can be very effective in improving performance, it breaks the consistency and isolation properties of transactions, which have to be handled manually by the programmer for a specific application. It also breaks another desirable property of transactions: composability. In this paper, we identify the composability problem and propose two STM system extensions to provide transaction composability in the presence of direct shared memory reads by transactions. TxFastRead gives the programmer the performance of a direct memory access to the shared memory data when used from a non-nested transaction, while performing necessary bookkeeping to guarantee composability when used from a nested transaction. TxFlush ensures consistency between nested transactions that use TxFastRead and can be inserted by the programmer or automatically by the compiler. These extensions give the programmer a similar level of flexibility and performance when optimizing the STM application as existing practices, while preserving composability. We propose two implementation schemes for these extensions: Lookup Scheme and Partial Commit Scheme. We evaluate our implementation of these extensions on several benchmarks on a 16-way SMP. The results show that our extensions provide performance competitive with hand-optimized non-composable techniques, while still maintaining transactional composability.

[1]  Keir Fraser,et al.  Language support for lightweight transactions , 2003, SIGP.

[2]  Maurice Herlihy,et al.  Software transactional memory for dynamic-sized data structures , 2003, PODC '03.

[3]  Bratin Saha,et al.  McRT-STM: a high performance software transactional memory system for a multi-core runtime , 2006, PPoPP '06.

[4]  David Eisenstat,et al.  Lowering the Overhead of Nonblocking Software Transactional Memory , 2006 .

[5]  Torvald Riegel,et al.  A Lazy Snapshot Algorithm with Eager Validation , 2006, DISC.

[6]  Hsien-Hsin S. Lee,et al.  Kicking the tires of software transactional memory: why the going gets tough , 2008, SPAA '08.

[7]  Nir Shavit,et al.  Transactional Locking II , 2006, DISC.

[8]  Antony L. Hosking,et al.  Nested Transactional Memory: Model and Preliminary Architecture Sketches , 2005 .

[9]  Maurice Herlihy,et al.  A Lazy Concurrent List-Based Set Algorithm , 2007, Parallel Process. Lett..

[10]  C. Y. Lee An Algorithm for Path Connections and Its Applications , 1961, IRE Trans. Electron. Comput..

[11]  Rui Zhang,et al.  Performance Optimizations for Software Transactional Memory , 2010 .

[12]  Rui Zhang,et al.  Commit phase in timestamp-based stm , 2008, SPAA '08.

[13]  J. Eliot B. Moss Open Nested Transactions: Semantics and Support , 2006 .

[14]  Mark Plesko,et al.  Optimizing memory transactions , 2006, PLDI '06.

[15]  Rachid Guerraoui,et al.  Polymorphic Contention Management , 2005, DISC.

[16]  Maurice Herlihy,et al.  Snapshots and software transactional memory , 2005, Sci. Comput. Program..

[17]  Håkan Grahn,et al.  Transactional memory , 2010, J. Parallel Distributed Comput..

[18]  James R. Larus,et al.  Transactional Memory , 2006, Transactional Memory.

[19]  Keir Fraser,et al.  Practical lock-freedom , 2003 .

[20]  Bratin Saha,et al.  Open nesting in software transactional memory , 2007, PPOPP.

[21]  Kunle Olukotun,et al.  STAMP: Stanford Transactional Applications for Multi-Processing , 2008, 2008 IEEE International Symposium on Workload Characterization.