Code Generation and Optimization for Transactional Memory Constructs in an Unmanaged Language

Transactional memory offers significant advantages for concurrency control compared to locks. This paper presents the design and implementation of transactional memory constructs in an unmanaged language. Unmanaged languages pose a unique set of challenges to transactional memory constructs - for example, lack of type and memory safety, use of function pointers, aliasing of local variables, and others. This paper describes novel compiler and runtime mechanisms that address these challenges and optimize the performance of transactions in an unmanaged environment. We have implemented these mechanisms in a production-quality C compiler and a high-performance software transactional memory runtime. We measure the effectiveness of these optimizations and compare the performance of lock-based versus transaction-based programming on a set of concurrent data structures and the SPLASH-2 benchmark suite. On a 16 processor SMP system, the transaction-based version of the SPLASH-2 benchmarks scales much better than the coarse-grain locking version and performs comparably to the fine-grain locking version. Compiler optimizations significantly reduce the overheads of transactional memory so that, on a single thread, the transaction-based version incurs only about 6.4% overhead compared to the lock-based version for the SPLASH-2 benchmark suite. Thus, our system is the first to demonstrate that transactions integrate well with an unmanaged language, and can perform as well as fine-grain locking while providing the programming ease of coarse-grain locking even on an unmanaged environment

[1]  David Eisenstat,et al.  Hardware Acceleration of Software Transactional Memory , 2005 .

[2]  Maurice Herlihy,et al.  Virtualizing transactional memory , 2005, 32nd International Symposium on Computer Architecture (ISCA'05).

[3]  Virendra J. Marathe,et al.  Adaptive Software Transactional Memory , 2005, DISC.

[4]  Anoop Gupta,et al.  The SPLASH-2 programs: characterization and methodological considerations , 1995, ISCA.

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

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

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

[8]  Ali-Reza Adl-Tabatabai,et al.  McRT-Malloc: a scalable transactional memory allocator , 2006, ISMM '06.

[9]  Kevin E. Moore,et al.  Log-based transactional memory , 2007 .

[10]  Tim Harris Design choices for language-based transactions , 2003 .

[11]  Aart J. C. Bik,et al.  Inside the Intel compiler , 2003 .

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

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

[14]  Mark Moir,et al.  Hybrid transactional memory , 2006, ASPLOS XII.

[15]  Antony L. Hosking,et al.  Nested transactional memory: Model and architecture sketches , 2006, Sci. Comput. Program..

[16]  Maurice Herlihy,et al.  Transactional Memory: Architectural Support For Lock-free Data Structures , 1993, Proceedings of the 20th Annual International Symposium on Computer Architecture.

[17]  Bradley C. Kuszmaul,et al.  Unbounded Transactional Memory , 2005, HPCA.

[18]  Kunle Olukotun,et al.  Architectural Semantics for Practical Transactional Memory , 2006, 33rd International Symposium on Computer Architecture (ISCA'06).

[19]  James R. Goodman,et al.  Transactional lock-free execution of lock-based programs , 2002, ASPLOS X.

[20]  Virendra J. Marathe,et al.  Design tradeoffs in modern software transactional memory systems , 2004 .

[21]  Kerstin Eder,et al.  International Symposium on Code Generation and Optimization. CGO 2003 , 2003, International Symposium on Code Generation and Optimization, 2003. CGO 2003..

[22]  Dan Grossman,et al.  AtomCaml: first-class atomicity via rollback , 2005, ICFP '05.

[23]  Vivek Sarkar,et al.  X10: an object-oriented approach to non-uniform cluster computing , 2005, OOPSLA '05.

[24]  Nir Shavit,et al.  Software transactional memory , 1995, PODC '95.

[25]  Brian T. Lewis,et al.  Compiler and runtime support for efficient software transactional memory , 2006, PLDI '06.

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

[27]  B. MossJ.Eliot,et al.  Nested transactional memory , 2006 .

[28]  Simon L. Peyton Jones,et al.  Composable memory transactions , 2005, CACM.

[29]  David A. Wood,et al.  LogTM: log-based transactional memory , 2006, The Twelfth International Symposium on High-Performance Computer Architecture, 2006..

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

[31]  Kunle Olukotun,et al.  The Atomos transactional programming language , 2006, PLDI '06.

[32]  L. Geppert Sun's big splash [Niagara microprocessor chip] , 2005, IEEE Spectrum.