Nothing Special   »   [go: up one dir, main page]

skip to main content
research-article

Is transactional programming actually easier?

Published: 09 January 2010 Publication History

Abstract

Chip multi-processors (CMPs) have become ubiquitous, while tools that ease concurrent programming have not. The promise of increased performance for all applications through ever more parallel hardware requires good tools for concurrent programming, especially for average programmers. Transactional memory (TM) has enjoyed recent interest as a tool that can help programmers program concurrently.
The transactional memory (TM) research community is heavily invested in the claim that programming with transactional memory is easier than alternatives (like locks), but evidence for or against the veracity of this claim is scant. In this paper, we describe a user-study in which 237 undergraduate students in an operating systems course implement the same programs using coarse and fine-grain locks, monitors, and transactions. We surveyed the students after the assignment, and examined their code to determine the types and frequency of programming errors for each synchronization technique. Inexperienced programmers found baroque syntax a barrier to entry for transactional programming. On average, subjective evaluation showed that students found transactions harder to use than coarse-grain locks, but slightly easier to use than fine-grained locks. Detailed examination of synchronization errors in the students' code tells a rather different story. Overwhelmingly, the number and types of programming errors the students made was much lower for transactions than for locks. On a similar programming problem, over 70% of students made errors with fine-grained locking, while less than 10% made errors with transactions.

References

[1]
Cyvis Software Complexity Visualizer, 2009.
[2]
Sync-gallery survey: http://www.cs.utexas.edu/users/witchel/tx/syncgallery-survey.html, 2009.
[3]
Sync-gallery survey: http://www.cs.utexas.edu/users/witchel/tx/sync-gallery-survey.html, 2009.
[4]
Ali-Reza Adl-Tabatabai, Brian T. Lewis, Vijay Menon, Brian R. Murphy, Bratin Saha, and Tatiana Shpeisman. Compiler and runtime support for efficient software transactional memory. In PLDI '06: Proceedings of the 2006 ACMSIGPLAN conference on Programming language design and implementation, pages 26--37, New York, NY, USA, 2006. ACM.
[5]
Lee Baugh, Naveen Neelakantam, and Craig Zilles. Using hardware memory protection to build a high-performance, strongly-atomic hybrid transactional memory. SIGARCH Comput. Archit. News, 36(3):115--126, 2008.
[6]
Colin Blundell, Joe Devietti, E. Christopher Lewis, and Milo M. K. Martin. Making the fast case common and the uncommon case simple in unbounded transactional memory. SIGARCH Comput. Archit. News, 35(2):24--34, 2007.
[7]
Jayaram Bobba, Neelam Goyal, Mark D. Hill, Michael M. Swift, and David A. Wood. Tokentm: Efficient execution of large transactions with hardware transactional memory. SIGARCH Comput. Archit. News, 36(3):127--138, 2008.
[8]
JaeWoong Chung, Chi Cao Minh, Austen McDonald, Travis Skare, Hassan Chafi, Brian D. Carlstrom, Christos Kozyrakis, and Kunle Olukotun. Tradeoffs in transactional memory virtualization. SIGPLAN Not., 41(11):371--381, 2006.
[9]
Luke Dalessandro, Virendra J. Marathe, Michael F. Spear, and Michael L. Scott. Capabilities and limitations of library-based software transactional memory in c++. In Proceedings of the 2nd ACM SIGPLAN Workshop on Transactional Computing. Portland, OR, Aug 2007.
[10]
D. Dice, O. Shalev, and N. Shavit. Transactional locking II. In DISC, 2006.
[11]
Dave Dice, Yossi Lev,MarkMoir, and Daniel Nussbaum. Early experience with a commercial hardware transactional memory implementation. SIGPLAN Not., 44(3):157--168, 2009.
[12]
L. Hammond, V. Wong, M. Chen, B. Hertzberg, B. Carlstrom, M. Prabhu, H. Wijaya, C. Kozyrakis, and K. Olukotun. Transactional memory coherence and consistency. In ISCA, 2004.
[13]
Tim Harris and Keir Fraser. Language support for lightweight transactions. In OOPSLA '03: Proceedings of the 18th annual ACM SIGPLAN conference on Object-oriented programing, systems, languages, and applications, pages 388--402, New York, NY, USA, 2003. ACM.
[14]
Tim Harris, Mark Plesko, Avraham Shinnar, and David Tarditi. Optimizing memory transactions. In PLDI '06: Proceedings of the 2006 ACM SIGPLAN conference on Programming language design and implementation, pages 14--25, New York, NY, USA, 2006. ACM.
[15]
Maurice Herlihy, Victor Luchangco, and Mark Moir. A flexible framework for implementing software transactional memory. In OOPSLA '06: Proceedings of the 21st annual ACM SIGPLAN conference on Object-oriented programming systems, languages, and applications, pages 253--262, New York, NY, USA, 2006. ACM.
[16]
Maurice Herlihy and J. Eliot B. Moss. Transactional memory: architectural support for lock-free data structures. SIGARCH Comput. Archit. News, 21(2):289--300, 1993.
[17]
Owen S. Hofmann, Christopher J. Rossbach, and Emmett Witchel. Maximum benefit from a minimal htm. In ASPLOS '09: Proceeding of the 14th international conference on Architectural support for programming languages and operating systems, pages 145--156, New York, NY, USA, 2009. ACM.
[18]
Yossi Lev and Jan-Willem Maessen. Split hardware transactions: true nesting of transactions using best-effort hardware transactional memory. In PPoPP '08: Proceedings of the 13th ACM SIGPLAN Symposium on Principles and practice of parallel programming, pages 197--206, New York, NY, USA, 2008. ACM.
[19]
Yossi Lev, Mark Moir, and Dan Nussbaum. PhTM: Phased transactional memory. In Workshop on Transactional Computing (TRANSACT), 2007.
[20]
Virendra J. Marathe, Michael F. Spear, Christopher Heriot, Athul Acharya, David Eisenstat, William N. Scherer III, and Michael L. Scott. Lowering the overhead of software transactional memory. Technical Report TR 893, Computer Science Department, University of Rochester, Mar 2006. Condensed version submitted for publication.
[21]
T. J. McCabe. A complexity measure. IEEE Trans. Softw. Eng., 2(4):308--320, 1976.
[22]
Austen McDonald, JaeWoong Chung, Brian D. Carlstrom, Chi Cao Minh, Hassan Chafi, Christos Kozyrakis, and Kunle Olukotun. Architectural semantics for practical transactional memory. SIGARCH Comput. Archit. News, 34(2):53--65, 2006.
[23]
Kevin E. Moore, Jayaram Bobba, Michelle J. Moravan, Mark D. Hill, and David A. Wood. Logtm: Log-based transactional memory. In Proceedings of the 12th International Symposium on High-Performance Computer Architecture, pages 254--265. Feb 2006.
[24]
Yang Ni, Adam Welc, Ali-Reza Adl-Tabatabai, Moshe Bach, Sion Berkowits, James Cownie, Robert Geva, Sergey Kozhukow, Ravi Narayanaswamy, Jeffrey Olivier, Serguei Preis, Bratin Saha, Ady Tal, and Xinmin Tian. Design and implementation of transactional constructs for C/C++. In OOPSLA '08: Proceedings of the 23rd ACM SIGPLAN conference on Object-oriented programming systems languages and applications, pages 195--212, New York, NY, USA, 2008. ACM.
[25]
Victor Pankratius, Ali-Reza Adl-Tabatabai, and Frank Otto. Does transactional memory keep its promises? results from and empirical study. publication, September 2009.
[26]
Ravi Rajwar, Maurice Herlihy, and Konrad Lai. Virtualizing transactional memory. In ISCA '05: Proceedings of the 32nd annual international symposium on Computer Architecture, pages 494--505,Washington, DC, USA, 2005. IEEE Computer Society.
[27]
Hany E. Ramadan, Christopher J. Rossbach, Donald E. Porter, Owen S. Hofmann, Aditya Bhandari, and Emmett Witchel. Metatm/txlinux: transactional memory for an operating system. In ISCA '07: Proceedings of the 34th annual international symposium on Computer architecture, pages 92--103, New York, NY, USA, 2007. ACM.
[28]
Hany E. Ramadan, Christopher J. Rossbach, and Emmett Witchel. Dependence-aware transactional memory for increased concurrency. InMICRO '08: Proceedings of the 2008 41st IEEE/ACMInternational Symposium on Microarchitecture, pages 246--257, Washington, DC, USA, 2008. IEEE Computer Society.
[29]
Hany E. Ramadan, Indrajit Roy, Maurice Herlihy, and Emmett Witchel. Committing conflicting transactions in an stm. In PPoPP'09: Proceedings of the 14th ACMSIGPLAN symposium on Principles and practice of parallel programming, pages 163--172, New York, NY, USA, 2009. ACM.
[30]
Christopher Rossbach, Owen Hofmann, and Emmett Witchel. Is transactional memory programming actually easier? In WDDD '09: Proc. 8th Workshop on Duplicating, Deconstructing, and Debunking, jun 2009.
[31]
Nir Shavit and Dan Touitou. Software transactional memory. In Proceedings of the 14th ACM Symposium on Principles of Distributed Computing, pages 204--213, Aug 1995.
[32]
Arrvindh Shriraman, Sandhya Dwarkadas, and Michael L. Scott. Flexible decoupled transactional memory support. In Proceedings of the 35th Annual International Symposium on Computer Architecture. Jun 2008.
[33]
Fuad Tabba, Cong Wang, James R. Goodman, and Mark Moir. NZTM: Nonblocking, zero-indirection transactional memory. In Workshop on Transactional Computing (TRANSACT), 2007.
[34]
Luke Yen, Jayaram Bobba, Michael R. Marty, Kevin E. Moore, Haris Volos, Mark D. Hill, Michael M. Swift, and David A. Wood. Logtm-se: Decoupling hardware transactional memory from caches. In HPCA '07: Proceedings of the 2007 IEEE 13th International Symposium on High Performance Computer Architecture, pages 261--272, Washington, DC, USA, 2007. IEEE Computer Society.

Cited By

View all
  • (2023)CSMV: A highly scalable multi-versioned software transactional memory for GPUsJournal of Parallel and Distributed Computing10.1016/j.jpdc.2023.04.002180(104701)Online publication date: Oct-2023
  • (2023)A parallel programming assessment for stream processing applications on multi-core systemsComputer Standards & Interfaces10.1016/j.csi.2022.10369184:COnline publication date: 1-Mar-2023
  • (2020)GPU Programming Productivity in Different Abstraction ParadigmsACM Transactions on Computing Education10.1145/341830120:4(1-27)Online publication date: 14-Oct-2020
  • Show More Cited By

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image ACM SIGPLAN Notices
ACM SIGPLAN Notices  Volume 45, Issue 5
PPoPP '10
May 2010
346 pages
ISSN:0362-1340
EISSN:1558-1160
DOI:10.1145/1837853
Issue’s Table of Contents
  • cover image ACM Conferences
    PPoPP '10: Proceedings of the 15th ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming
    January 2010
    372 pages
    ISBN:9781605588773
    DOI:10.1145/1693453
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 09 January 2010
Published in SIGPLAN Volume 45, Issue 5

Check for updates

Author Tags

  1. optimistic concurrency
  2. synchronization
  3. transactional memory

Qualifiers

  • Research-article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)15
  • Downloads (Last 6 weeks)3
Reflects downloads up to 10 Nov 2024

Other Metrics

Citations

Cited By

View all
  • (2023)CSMV: A highly scalable multi-versioned software transactional memory for GPUsJournal of Parallel and Distributed Computing10.1016/j.jpdc.2023.04.002180(104701)Online publication date: Oct-2023
  • (2023)A parallel programming assessment for stream processing applications on multi-core systemsComputer Standards & Interfaces10.1016/j.csi.2022.10369184:COnline publication date: 1-Mar-2023
  • (2020)GPU Programming Productivity in Different Abstraction ParadigmsACM Transactions on Computing Education10.1145/341830120:4(1-27)Online publication date: 14-Oct-2020
  • (2019)Convoider: A Concurrency Bug Avoider Based on Transparent Software Transactional MemoryInternational Journal of Parallel Programming10.1007/s10766-019-00642-1Online publication date: 12-Sep-2019
  • (2017)SeerACM Transactions on Computer Systems10.1145/313203635:3(1-41)Online publication date: 14-Nov-2017
  • (2017)A survey of the double‐fetch vulnerabilitiesConcurrency and Computation: Practice and Experience10.1002/cpe.434530:6Online publication date: 12-Oct-2017
  • (2016)ProteusTMACM SIGARCH Computer Architecture News10.1145/2980024.287238544:2(757-771)Online publication date: 25-Mar-2016
  • (2016)ProteusTMACM SIGOPS Operating Systems Review10.1145/2954680.287238550:2(757-771)Online publication date: 25-Mar-2016
  • (2016)ProteusTMACM SIGPLAN Notices10.1145/2954679.287238551:4(757-771)Online publication date: 25-Mar-2016
  • (2016)An empirical study on the impact of C++ lambdas and programmer experienceProceedings of the 38th International Conference on Software Engineering10.1145/2884781.2884849(760-771)Online publication date: 14-May-2016
  • Show More Cited By

View Options

Get Access

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media