skip to main content
research-article

Prettier concurrency: purely functional concurrent revisions

Published:22 September 2011Publication History
Skip Abstract Section

Abstract

This article presents an extension to the work of Launchbury and Peyton-Jones on the ST monad. Using a novel model for concurrency, called concurrent revisions [3,5], we show how we can use concurrency together with imperative mutable variables, while still being able to safely convert such computations (in the Rev monad) into pure values again.

In contrast to many other transaction models, like software transactional memory (STM), concurrent revisions never use rollback and always deterministically resolve conflicts. As a consequence, concurrent revisions integrate well with side-effecting I/O operations. Using deterministic conflict resolution, concurrent revisions can deal well with situations where there are many conflicts between different threads that modify a shared data structure. We demonstrate this by describing a concurrent game with conflicting concurrent tasks.

Skip Supplemental Material Section

Supplemental Material

_talk8.mp4

References

  1. M. Abadi, A. Birrell, T. Harris, and M. Isard. Semantics of transactional memory and automatic mutual exclusion. In Principles of Prog. Lang. (POPL), pages 63--74, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. H. Berenson, P. Bernstein, J. Gray, J. Melton, E. O'Neil, and P. O'Neil. A critique of ANSI SQL isolation levels. In Proceedings of SIGMOD, pages 1--10, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Sebastian Burckhardt, Alexandro Baldassion, and Daan Leijen. Concurrent programming with revisions and isolation types. In OOPSLA'10, October 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Sebastian Burckhardt, Manuel Fahndrich, and Daan Leijen. Roll Forward, not Back -- A Case for Deterministic Conflict Resolution. In The 2nd Workshop on Determinism and Correctness in Parallel Programming, 2011.Google ScholarGoogle Scholar
  5. Sebastian Burckhardt and Daan Leijen. Semantics of concurrent revisions. In European Symposium on Programming (ESOP'11), 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Manuel M. T. Chakravarty, Gabriele Keller, Roman Lechtchinsky, and Wolf Pfannenstiel. Nepal -- Nested Data-Parallelism in Haskell. In Euro-Par 2001: Parallel Processing, LNCS 2150, pages 524--534, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. A. Fekete, D. Liarokapis, E. O'Neil, P. O'Neil, and D. Shasha. Making snapshot isolation serializable. ACM Trans. Database Syst., 30(2):492--528, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. M. Frigo, P. Halpern, C. E. Leiserson, and S. Lewin-Berlin. Reducers and other cilk++ hyperobjects. In Sym. on Par. Algorithms and Architectures (SPAA), pages 79--90, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Tim Harris, Simon Marlow, Simon Peyton-Jones, and Maurice Herlihy. Composable memory transactions. In Principles and Practice of Parallel Programming, PPoPP '05, pages 48--60, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. M. Herlihy and E. Koskinen. Transactional boosting: a methodology for highly-concurrent transactional objects. In Principles and Practice of Parallel Programming (PPoPP), pages 207--216, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. M. Herlihy and J. Wing. Linearizability: a correctness condition for concurrent objects. ACM Trans. Program. Lang. Syst., 12(3):463--492, 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. E. Koskinen, M. Parkinson, and M. Herlihy. Coarse-grained transactions. In Principles of Programming Languages (POPL), pages 19--30, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. M. Kulkarni, K. Pingali, B. Walter, G. Ramanarayanan, K. Bala, and L. Chew. Optimistic parallelism requires abstractions. In (PLDI), 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Daan Leijen. Haskell revisions. Implementation available at www.research.microsoft.com/ daan/hsrevisions, 2011.Google ScholarGoogle Scholar
  15. Daan Leijen and Erik Meijer. Domain specific embedded compilers. In 2nd USENIX Conference on Domain Specific Languages (DSL'99), pages 109--122, Austin, Texas, October 1999. Also in ACM SIGPLAN Notices 35, 1, (Jan. 2000). Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Simon Marlow, Patrick Maier, Hans-Wolfgang Loidl, Mustafa K. Aswad, and Phil Trinder. Seq no more: Better strategies for parallel haskell. In 3rd Haskell Symposium, pages 91--102, September 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Simon Marlow, Simon L. Peyton-Jones, and Satnam Singh. Runtime support for multicore Haskell. In ICFP 2009 -- Intl. Conf. on Functional Programming, pages 65--78, Edinburgh, Scotland, August 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. P.A.Bernstein and N.Goodman. Multiversion concurrency control--theory and algorithms. ACM Trans. Database Syst., 8(4):465--483, 1983. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. P.A.Bernstein, V.Hadzilacos, and N.Goodman. Concurrency Control and Recovery in Database Systems. Addison-Wesley, 1987. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Simon Peyton Jones. Beautiful concurrency, 2007. Appears as a chapter in "Beautiful Code: Leading programmers explain how they think" (O'Reilly).Google ScholarGoogle Scholar
  21. Simon Peyton Jones, Andrew Gordon, and Sigbjorn Finne. Concurrent Haskell. In 23rd ACM Symposium on Principles of Programming Languages, pages 295--308, January 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Simon Peyton Jones, Roman Leshchinskiy, Gabrielle Keller, and Manuel M. T. Chakravarty. Harnessing the Multicores: Nested Data Parallelism in Haskell. In IARCS Annual Conference on Foundations of Software Technology and Theoretical Computer Science (FSTTCS 2008), 2008.Google ScholarGoogle Scholar
  23. Simon L Peyton Jones and John Launchbury. State in Haskell. Lisp and Symbolic Comp., 8(4):293--341, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. K. Randall. Cilk: Efficient Multithreaded Computing. PhD thesis, Dept. of Electrical Engineering and Computer Science, MIT, May 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. T. Riegel, C. Fetzer, and P. Felber. Snapshot isolation for software transactional memory. In Workshop on Transactional Computing (TRANSACT), 2006.Google ScholarGoogle Scholar
  26. Philip W. Trinder, Kevin Hammond, Hans-Wolfgang Loidl, and Simon L. Peyton Jones. Algorithm + Strategy = Parallelism. Journal of Functional Programming, 8(1):23--60, January 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Philip W. Trinder, Kevin Hammond, James S. Mattson Jr., Andrew S. Partridge, and Simon L. Peyton Jones. GUM: a portable implementation of Haskell. In Programming Language Design and Implementation, May 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Prettier concurrency: purely functional concurrent revisions

    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 46, Issue 12
      Haskell '11
      December 2011
      129 pages
      ISSN:0362-1340
      EISSN:1558-1160
      DOI:10.1145/2096148
      Issue’s Table of Contents
      • cover image ACM Conferences
        Haskell '11: Proceedings of the 4th ACM symposium on Haskell
        September 2011
        136 pages
        ISBN:9781450308601
        DOI:10.1145/2034675

      Copyright © 2011 ACM

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 22 September 2011

      Check for updates

      Qualifiers

      • research-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!