skip to main content
article

Transactional events

Published:16 September 2006Publication History
Skip Abstract Section

Abstract

Concurrent programs require high-level abstractions in order to manage complexity and enable compositional reasoning. In this paper, we introduce a novel concurrency abstraction, dubbed transactional events, which combines first-class synchronous messagepassing events with all-or-nothing transactions. This combination enables simple solutions to interesting problems in concurrent programming. For example, guarded synchronous receive can be implemented as an abstract transactional event, whereas in other languages it requires a non-abstract, non-modular protocol. Likewise, three-way rendezvous can also be implemented as an abstract transactional event, which is impossible using first-class events alone. Both solutions are easy to code and easy to reason about.The expressive power of transactional events arises from a sequencing combinator whose semantics enforces an all-or-nothing transactional property - either both of the constituent events synchronize in sequence or neither of them synchronizes. This sequencing combinator, along with a non-deterministic choice combinator, gives transactional events the compositional structure of a monad-with-plus. We provide a formal semantics for and a preliminary implementation of transactional events.

References

  1. Joe Armstrong, Robert Virding, Claes Wikström, and Mike Williams. Concurrent Programming in Erlang. Prentice-Hall, second edition, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Matthew Flatt and Robert Bruce Findler. Kill-safe synchronization abstractions. In The Conference on Programming Language Design and Implementation (PLDI), pages 47--58, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Emden R. Gasner and John H. Reppy. A multi-threaded high-order user interface toolkit. In Len Bass and Prasun Dewan, editors, User Interface Software, volume 1 of Software Trends, chapter 4, pages 61--80. John Wiley & Sons, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Glasgow Haskell Compiler. http://www.haskell.org/ghc.Google ScholarGoogle Scholar
  5. Tim Harris and Keir Fraser. Language support for lightweight transactions. In The Conference on Object-oriented Programing, Systems, Languages, and Applications (OOPSLA), pages 388--402, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Tim Harris, Simon Marlow, and Simon Peyton Jones. Haskell on a shared-memory multiprocessor. In The Workshop on Haskell, pages 49--61, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Tim Harris, Simon Marlow, Simon Peyton Jones, and Maurice Herlihy. Composable memory transactions. In The Symposium on Principles and Practice of Parallel Programming (PPoPP), pages 48--60, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Maurice Herlihy and J. Eliot B. Moss. Transactional memory: architectural support for lock-free data structures. In The International Symposium on Computer Architecture (ISCA), pages 289--300, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Ralf Hinze. Deriving backtracking monad transformers (functional pearl). In The International Conference on Functional Programming (ICFP), pages 186--197, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. C.A.R. Hoare. Communicating sequential processes. Commun. ACM, 21(8):666--677, 1978. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Alan Jeffrey. A fully abstract semantics for a concurrent functional language with monadic types. In The Symposium on Logic in Computer Science (LICS), pages 255--264, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Einar Karlsen. The UniForM concurrency toolkit and its extensions to Concurrent Haskell. In The Glasgow Functional Programming Workshop (GFPW), 1997.Google ScholarGoogle Scholar
  13. Oleg Kiselyov, Chung-chieh Shan, Daniel Friedman, and Amr Sabry. Backtracking, interleaving, and terminating monad transformers (functional pearl). In The International Conference on Functional Programming (ICFP), pages 192--203, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Simon Marlow, Simon Peyton Jones, Andrew Moran, and John Reppy. Asynchronous exceptions in Haskell. In The Conference on Programming Language Design and Implementation (PLDI), pages 274--285, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Eugino Moggi. Notions of computation and monads. Information and Computation, 93(1):55--92, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Prakash Panangaden and John Reppy. The essence of concurrent ML. In Flemming Nielson, editor, ML with Concurrency: Design, Analysis, Implementation, and Application, Springer Monographs in Computer Science. Springer-Verlag, 1997.Google ScholarGoogle Scholar
  17. Simon Peyton Jones. Tackling the awkward squad: monadic input/output, concurrency, exceptions, and foreign-language calls in Haskell. In T. Hoare, B. Broy, and R. Steinbrüggen, editors, Engineering Theories of Software Construction, volume 180 of NATO Science Series: Computer & Systems Sciences. IOS Press, 2001.Google ScholarGoogle Scholar
  18. Simon Peyton Jones, Andrew Gordon, and Sigbjorn Finne. Concurrent Haskell. In The Symposium on Principles of Programming Languages (POPL), pages 295--308, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Simon Peyton Jones and Philip Wadler. Imperative functional programming. In The Symposium on Principles of Programming Languages (POPL), pages 71--84, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Rob Pike. A concurrent window system. Computing Systems, 2(2):133--153, 1989.Google ScholarGoogle Scholar
  21. John Reppy. Concurrent Programming in ML. Cambridge University Press, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. George Russell. Events in Haskell, and how to implement them. In The International Conference on Functional Programming (ICFP), pages 157--168, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Davide Sanggiorgi and David Walker. The Π-calculus: A Theory of Mobile Processes. Cambridge University Press, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Franklyn Turbak. First-class synchronization barriers. In The International Conference on Functional Programming (ICFP), pages 157--168, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Philip Wadler. Monads for functional programming. In Johan Jeuring and Erik Meijer, editors, Advanced Functional Programming, volume 925 of Lecture Notes in Computer Science. Springer-Verlag, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Adam Welc, Suresh Jagannathan, and Antony L. Hosking. Transactional monitors for concurrent objects. In The European Conference on Object-Oriented Programming (ECOOP), pages 519--542, 2004.Google ScholarGoogle ScholarCross RefCross Ref

Index Terms

  1. Transactional events

        Recommendations

        Comments

        Login options

        Check if you have access through your login credentials or your institution to get full access on this article.

        Sign in

        Full Access

        • Published in

          cover image ACM SIGPLAN Notices
          ACM SIGPLAN Notices  Volume 41, Issue 9
          Proceedings of the 2006 ICFP conference
          September 2006
          296 pages
          ISSN:0362-1340
          EISSN:1558-1160
          DOI:10.1145/1160074
          Issue’s Table of Contents
          • cover image ACM Conferences
            ICFP '06: Proceedings of the eleventh ACM SIGPLAN international conference on Functional programming
            September 2006
            308 pages
            ISBN:1595933093
            DOI:10.1145/1159803
            • General Chair:
            • John Reppy,
            • Program Chair:
            • Julia Lawall

          Copyright © 2006 ACM

          Publisher

          Association for Computing Machinery

          New York, NY, United States

          Publication History

          • Published: 16 September 2006

          Check for updates

          Qualifiers

          • article

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader
        About Cookies On This Site

        We use cookies to ensure that we give you the best experience on our website.

        Learn more

        Got it!