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.
Supplemental Material
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- Sebastian Burckhardt, Alexandro Baldassion, and Daan Leijen. Concurrent programming with revisions and isolation types. In OOPSLA'10, October 2010. Google Scholar
Digital Library
- 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 Scholar
- Sebastian Burckhardt and Daan Leijen. Semantics of concurrent revisions. In European Symposium on Programming (ESOP'11), 2011. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- M. Herlihy and J. Wing. Linearizability: a correctness condition for concurrent objects. ACM Trans. Program. Lang. Syst., 12(3):463--492, 1990. Google Scholar
Digital Library
- E. Koskinen, M. Parkinson, and M. Herlihy. Coarse-grained transactions. In Principles of Programming Languages (POPL), pages 19--30, 2010. Google Scholar
Digital Library
- M. Kulkarni, K. Pingali, B. Walter, G. Ramanarayanan, K. Bala, and L. Chew. Optimistic parallelism requires abstractions. In (PLDI), 2007. Google Scholar
Digital Library
- Daan Leijen. Haskell revisions. Implementation available at www.research.microsoft.com/ daan/hsrevisions, 2011.Google Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- P.A.Bernstein and N.Goodman. Multiversion concurrency control--theory and algorithms. ACM Trans. Database Syst., 8(4):465--483, 1983. Google Scholar
Digital Library
- P.A.Bernstein, V.Hadzilacos, and N.Goodman. Concurrency Control and Recovery in Database Systems. Addison-Wesley, 1987. Google Scholar
Digital Library
- Simon Peyton Jones. Beautiful concurrency, 2007. Appears as a chapter in "Beautiful Code: Leading programmers explain how they think" (O'Reilly).Google Scholar
- 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 Scholar
Digital Library
- 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 Scholar
- Simon L Peyton Jones and John Launchbury. State in Haskell. Lisp and Symbolic Comp., 8(4):293--341, 1995. Google Scholar
Digital Library
- K. Randall. Cilk: Efficient Multithreaded Computing. PhD thesis, Dept. of Electrical Engineering and Computer Science, MIT, May 1998. Google Scholar
Digital Library
- T. Riegel, C. Fetzer, and P. Felber. Snapshot isolation for software transactional memory. In Workshop on Transactional Computing (TRANSACT), 2006.Google Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
Index Terms
Prettier concurrency: purely functional concurrent revisions
Recommendations
Prettier concurrency: purely functional concurrent revisions
Haskell '11: Proceedings of the 4th ACM symposium on HaskellThis 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 ...
Constraint-preserving snapshot isolation
A method for detecting potential violations of integrity constraints of concurrent transactions running under snapshot isolation (SI) is presented. Although SI provides a high level of isolation, it does not, by itself, ensure that all integrity ...
Transaction Repair for Multi-Version Concurrency Control
SIGMOD '17: Proceedings of the 2017 ACM International Conference on Management of DataThe optimistic variants of Multi-Version Concurrency Control (MVCC) avoid blocking concurrent transactions at the cost of having a validation phase. Upon failure in the validation phase, the transaction is usually aborted and restarted from scratch. The ...







Comments