skip to main content
research-article

Partial aborts for transactions via first-class continuations

Published: 29 August 2015 Publication History

Abstract

Software transactional memory (STM) has proven to be a useful abstraction for developing concurrent applications, where programmers denote transactions with an atomic construct that delimits a collection of reads and writes to shared mutable references. The runtime system then guarantees that all transactions are observed to execute atomically with respect to each other. Traditionally, when the runtime system detects that one transaction conflicts with another, it aborts one of the transactions and restarts its execution from the beginning. This can lead to problems with both execution time and throughput. In this paper, we present a novel approach that uses first-class continuations to restart a conflicting transaction at the point of a conflict, avoiding the re-execution of any work from the beginning of the transaction that has not been compromised. In practice, this allows transactions to complete more quickly, decreasing execution time and increasing throughput. We have implemented this idea in the context of the Manticore project, an ML-family language with support for parallelism and concurrency. Crucially, we rely on constant-time continuation capturing via a continuation-passing-style (CPS) transformation and heap-allocated continuations. When comparing our STM that performs partial aborts against one that performs full aborts, we achieve a decrease in execution time of up to 31% and an increase in throughput of up to 351%.

References

[1]
{ABFR11} Auhagen, S., L. Bergstrom, M. Fluet, and J. Reppy. Garbage Collection for Multicore NUMA Machines. In MSPC 2011: Memory Systems Performance and Correctness, San José, California, USA, June 2011. ACM. {App89} Appel, A. W. Simple generational garbage collection and fast allocation. Software – Practice and Experience, 19(2), 1989, pp. 171–183. {App92} Appel, A. W. Compiling with Continuations. Cambridge University Press, Cambridge, England, 1992.
[2]
{Rep89} Reppy, J. H. First-class synchronous operations in Standard ML. Technical Report TR 89-1068, Department of Computer Science, Cornell University, December 1989.
[3]
{Rep99} Reppy, J. H. Concurrent Programming in ML. Cambridge University Press, Cambridge, England, 1999.
[4]
{RFF06} Riegel, T., P. Felber, and C. Fetzer. A lazy snapshot algorithm with eager validation. In Proceedings of the 20th International Distributed Computing Conference, vol. 4167 of Lecture Notes in Computer Science, Stockholm, Sweden, 2006. Springer-Verlag, pp. 284–298. {RFF07} Riegel, T., C. Fetzer, and P. Felber. Time-based transactional memory with scalable time bases. In SPAA ’07, San Diego, California, USA, 2007. ACM, pp. 221–228. {RP00} Ramsey, N. and S. Peyton Jones. Featherweight concurrency in a portable assembly language. Unpublished paper available at https://www.cs.tufts.edu/˜nr/ pubs/c--con-abstract.html, November 2000.
[5]
{RRX09} Reppy, J., C. Russo, and Y. Xiao. Parallel Concurrent ML. In Proceedings of the 14th ACM SIGPLAN International Conference on Functional Programming ICFP ’09, Edinburgh, Scotland, UK, August–September 2009. ACM, pp. 257–268. {SDMS09} Spear, M. F., L. Dalessandro, V. J. Marathe, and M. L. Scott. A comprehensive strategy for contention management in software transactional memory. In PPoPP ’09, Raleigh, NC, USA, 2009. ACM, pp. 141–150. {Shi97} Shivers, O. Continuations and threads: Expressing machine concurrency directly in advanced languages. In Proceedings of the Second ACM SIGPLAN Workshop on Continuations (CW ’97). ACM, January 1997.

Cited By

View all
  • (2022)Design and implementation of a fully transparent partial abort support for software transactional memorySoftware: Practice and Experience10.1002/spe.313452:11(2456-2475)Online publication date: 8-Aug-2022
  • (2023)Efficient Parallel Functional Programming with EffectsProceedings of the ACM on Programming Languages10.1145/35912847:PLDI(1558-1583)Online publication date: 6-Jun-2023
  • (2022)Entanglement detection with near-zero costProceedings of the ACM on Programming Languages10.1145/35476466:ICFP(679-710)Online publication date: 31-Aug-2022
  • Show More Cited By

Index Terms

  1. Partial aborts for transactions via first-class continuations

      Recommendations

      Comments

      Information & Contributors

      Information

      Published In

      cover image ACM SIGPLAN Notices
      ACM SIGPLAN Notices  Volume 50, Issue 9
      ICFP '15
      September 2015
      436 pages
      ISSN:0362-1340
      EISSN:1558-1160
      DOI:10.1145/2858949
      • Editor:
      • Andy Gill
      Issue’s Table of Contents
      • cover image ACM Conferences
        ICFP 2015: Proceedings of the 20th ACM SIGPLAN International Conference on Functional Programming
        August 2015
        436 pages
        ISBN:9781450336697
        DOI:10.1145/2784731
      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: 29 August 2015
      Published in SIGPLAN Volume 50, Issue 9

      Check for updates

      Author Tags

      1. First-Class Continuations
      2. Software Transactional Memory

      Qualifiers

      • Research-article

      Funding Sources

      • NSF

      Contributors

      Other Metrics

      Bibliometrics & Citations

      Bibliometrics

      Article Metrics

      • Downloads (Last 12 months)3
      • Downloads (Last 6 weeks)0
      Reflects downloads up to 13 Dec 2024

      Other Metrics

      Citations

      Cited By

      View all
      • (2022)Design and implementation of a fully transparent partial abort support for software transactional memorySoftware: Practice and Experience10.1002/spe.313452:11(2456-2475)Online publication date: 8-Aug-2022
      • (2023)Efficient Parallel Functional Programming with EffectsProceedings of the ACM on Programming Languages10.1145/35912847:PLDI(1558-1583)Online publication date: 6-Jun-2023
      • (2022)Entanglement detection with near-zero costProceedings of the ACM on Programming Languages10.1145/35476466:ICFP(679-710)Online publication date: 31-Aug-2022
      • (2021)Provably space-efficient parallel functional programmingProceedings of the ACM on Programming Languages10.1145/34342995:POPL(1-33)Online publication date: 4-Jan-2021
      • (2020)From folklore to fact: comparing implementations of stacks and continuationsProceedings of the 41st ACM SIGPLAN Conference on Programming Language Design and Implementation10.1145/3385412.3385994(75-90)Online publication date: 11-Jun-2020
      • (2019)Disentanglement in nested-parallel programsProceedings of the ACM on Programming Languages10.1145/33711154:POPL(1-32)Online publication date: 20-Dec-2019
      • (2018)Compiling with Continuations and LLVMElectronic Proceedings in Theoretical Computer Science10.4204/EPTCS.285.5285(131-142)Online publication date: 31-Dec-2018
      • (2018)Hierarchical memory management for mutable stateACM SIGPLAN Notices10.1145/3200691.317849453:1(81-93)Online publication date: 10-Feb-2018
      • (2018)Hierarchical memory management for mutable stateProceedings of the 23rd ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming10.1145/3178487.3178494(81-93)Online publication date: 10-Feb-2018

      View Options

      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