Does Transactional Memory Keep Its Promises? Results from an Empirical Study.

Transactional Memory (TM) promises to simplify parallel programming by replacing locks with atomic transactions. This is the first paper to assess the value proposition of TM based on a comparative case study with real programmers. Twelve students, working in teams of two, wrote a parallel desktop search engine in C/C++ during a fifteen week lab. Three randomly chosen study groups (TM teams) competed for the best performance using Intel’s Software Transactional Memory compiler and Pthreads, while three control groups (locks teams) competed using just Pthreads. The study provides empirical evidence that both supports the TM value proposition and at the same time points to problems with TM. The winning TM team’s program performed better than that of the winning locks team, and the TM winners were the first to have a prototype parallel search engine, four weeks earlier than the locks winners. Compared to the locks teams, the TM teams spent less than half the time debugging segmentation faults. On the other hand, TM teams had more problems tuning performance because TM performance was hard to predict. The study also provides insights into general difficulties programmers have with parallel programming. Some insights are technical; for example, some students wrongly assumed that it is safe to read shared variables outside critical sections, resulting in data races in the winning teams’ programs. Other insights are non-technical, including psychological ones; for example, the TM teams were less afraid of using parallel constructs, yet two of the teams procrastinated parallelization. Based on our insights, we elaborate on future research directions. We suggest refinements to TM constructs and tools. We also sketch how to automate similar case studies and propose a methodology for automating the evaluation of new language features for parallelism.

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

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

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

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

[5]  Victor Luchangco,et al.  The Fortress Language Specification Version 1.0 , 2007 .

[6]  Jan Vitek,et al.  STMBench7: a benchmark for software transactional memory , 2007, EuroSys '07.

[7]  Daniel S. Hirschberg,et al.  Data compression , 1987, CSUR.

[8]  Donald E. Porter,et al.  TxLinux: using and managing hardware transactional memory in an operating system , 2007, SOSP.

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

[10]  Kai Li,et al.  The PARSEC benchmark suite: Characterization and architectural implications , 2008, 2008 International Conference on Parallel Architectures and Compilation Techniques (PACT).

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

[12]  Grigori Melnik,et al.  On the success of empirical studies in the international conference on software engineering , 2006, ICSE.

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

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

[15]  Mikel Luján,et al.  A Study of a Transactional Parallel Routing Algorithm , 2007, 16th International Conference on Parallel Architecture and Compilation Techniques (PACT 2007).

[16]  Maged M. Michael,et al.  Software Transactional Memory: Why Is It Only a Research Toy? , 2008, ACM Queue.

[17]  Mikel Luján,et al.  Lee-TM: A Non-trivial Benchmark Suite for Transactional Memory , 2008, ICA3PP.

[18]  Per Runeson,et al.  Guidelines for conducting and reporting case study research in software engineering , 2009, Empirical Software Engineering.

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

[20]  C. A. R. Hoare,et al.  Monitors: an operating system structuring concept , 1974, CACM.

[21]  David R. Butenhof Programming with POSIX threads , 1993 .

[22]  Hugh E. Williams,et al.  Burst tries: a fast, efficient data structure for string keys , 2002, TOIS.

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

[24]  JUSTIN ZOBEL,et al.  Inverted files for text search engines , 2006, CSUR.

[25]  Satish Narayanasamy,et al.  Automatically classifying benign and harmful data races using replay analysis , 2007, PLDI '07.

[26]  Alistair Moffat,et al.  Efficient online index construction for text databases , 2008, TODS.

[27]  Eduard Ayguadé,et al.  Atomic quake: using transactional memory in an interactive multiplayer game server , 2009, PPoPP '09.

[28]  Adam Welc,et al.  Design and implementation of transactional constructs for C/C++ , 2008, OOPSLA '08.

[29]  Corporate Ieee,et al.  Information Technology-Portable Operating System Interface , 1990 .

[30]  Michael F. Spear,et al.  Delaunay Triangulation with Transactions and Barriers , 2007, 2007 IEEE 10th International Symposium on Workload Characterization.

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

[32]  Walter F. Tichy,et al.  Hints for Reviewing Empirical Work in Software Engineering , 2000, Empirical Software Engineering.

[33]  Andreas Reuter,et al.  Transaction Processing: Concepts and Techniques , 1992 .

[34]  Kunle Olukotun,et al.  The OpenTM Transactional Application Programming Interface , 2007, 16th International Conference on Parallel Architecture and Compilation Techniques (PACT 2007).

[35]  Emmett Witchel,et al.  Is transactional programming actually easier? , 2010, PPoPP '10.