ABSTRACT
Correct handling of concurrently accessed external resources is a demanding problem in programming. The standard approaches rely on database transactions or concurrency mechanisms like locks. The paper considers two such resources, global variables and databases, and defines transactional APIs for them in Haskell. The APIs provide a novel flavor of user-level transactions which are particularly suitable in the context of web-based systems. This suitability is demonstrated by providing a second implementation in the context of WASH, a Haskell-based Web programming system. The underlying implementation framework works for both kinds of resources and can serve as a blueprint for further implementations of user-level transactions. The Haskell type system provides an encapsulation of the transactional scope that avoids unintended breakage of the transactional guarantees.
- E. F. Codd. Extending the database relational model to capture more meaning. ACM Trans. Database Syst., 4(4):397--434, 1979. Google ScholarDigital Library
- E.W. Dijkstra. Cooperating sequential processes. In F. Genys, editor, Programming Languages, pages 43--112. Academic Press, New York, 1968.Google Scholar
- N. Haines, D. Kindred, J. G. Morrisett, S. M. Nettles, and J. M. Wing. Composing first-class transactions. ACM Trans. Programming Languages and Systems, 16(6):1719--1736, 1994. Google ScholarDigital Library
- T. Harris and K. Fraser. Language support for lightweight transactions. In OOPSLA '03: Proc. 18th ACM Conf., pages 388--402, Anaheim, CA, USA, 2003. ACM Press, New York. Google ScholarDigital Library
- T. Harris, S. Marlow, S. Peyton Jones, and M. Herlihy. Composable memory transactions. In Sixteenth ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming, Chicago, IL, USA, June 2005. ACM Press. Google ScholarDigital Library
- Haskell 98, a non-strict, purely functional language. http://www.haskell.org/definition, Dec. 1998.Google Scholar
- M. Herlihy. Apologizing versus asking permission: Optimistic concurrency control for abstract data types. ACM Trans. Database Syst., 15(1):96--124, 1990. Google ScholarDigital Library
- M. Herlihy, V. Luchangco, M. Moir, and I. William N. Scherer. Software transactional memory for dynamic-sized data structures. In PODC '03: Proceedings of the Twentysecond Annual Symposium on Principles of Distributed Computing, pages 92--101, Boston, Massachusetts, 2003. ACM Press, New York, NY, USA. Google ScholarDigital Library
- C. A. R. Hoare. Monitors: An operating system structuring concept. Communications of the ACM, 17(10):549--557, Oct. 1974. Google ScholarDigital Library
- J. Launchbury and S. L. Peyton Jones. State in Haskell. Lisp and Symbolic Computation, 8(4):293--341, Dec. 1995. Google ScholarDigital Library
- D. Leijen and E. Meijer. Domain-specific embedded compilers. In 2nd Conference on Domain-Specific Languages, Austin, Texas, USA, Oct. 1999. USENIX. http://usenix.org/events/dsl99/index.html. Google ScholarDigital Library
- S. Microsystems. Enterprise Java Beans Specification 2.1. http://java.sun.com/products/ejb/docs.html, Nov. 2003.Google Scholar
- E. Moggi and A. Sabry. Monadic encapsulation of effects: a revised approach (extended version). J. Functional Programming, 11(6):591--627, 2001. Google ScholarDigital Library
- E. Peligri-Llopart and L. Cable. Java Server Pages Specification. http://java.sun.com/products/jsp/index.html, 1999.Google Scholar
- S. Peyton Jones, editor. Haskell 98 Language and Libraries, The Revised Report. Cambridge University Press, 2003.Google Scholar
- S. Peyton Jones, A. Gordon, and S. Finne. Concurrent Haskell. In Proc. 1996 ACM SIGPLAN Symp. on Principles of Programming Languages, pages 295--308, St. Petersburg Beach, Florida, USA, Jan. 1996. ACM Press. Google ScholarDigital Library
- R. Ramakrishnan. Database Management Systems. McGraw-Hill, 1997. Google ScholarDigital Library
- M. F. Ringenburg and D. Grossman. AtomCaml: First-class atomicity via rollback. In B. C. Pierce, editor, Proc. Intl. Conf. Functional Programming 2005, pages 92--104, Tallinn, Estonia, Sept. 2005. ACM Press, New York. Google ScholarDigital Library
- N. Shavit and D. Touitou. Software transactional memory. In PODC '95: Proceedings of the Fourteenth Annual ACM Symposium on Principles of Distributed Computing, pages 204--213, Ottowa, Ontario, Canada, 1995. ACM Press, New York, NY, USA. Google ScholarDigital Library
- A. Silberschatz, H. Korth, and S. Sudarshan. Database System Concepts. McGraw-Hill, third edition, 1997. Google ScholarDigital Library
- P. Thiemann. An embedded domain-specific language for type-safe server-side Web-scripting. ACM Trans. Internet Technology, 5(1):1--46, 2005. Google ScholarDigital Library
- P. Thiemann. Wash server pages. In Proc. Eighth International Symposium on Functional and Logic Programming FLOPS 2006, Fuji Susono, Japan, Apr. 2006. Springer. Google ScholarDigital Library
- A. Welc, S. Jagannathan, and A. Hosking. Safe futures for Java. In OOPSLA '05: Proceedings of the 20th ACM SIGPLAN conference on Object oriented programming, systems, languages, and applications, pages 439--453, San Diego, CA, USA, 2005. ACM Press, New York. Google ScholarDigital Library
Index Terms
- User-level transactional programming in Haskell
Recommendations
The Atomos transactional programming language
Proceedings of the 2006 PLDI ConferenceAtomos is the first programming language with implicit transactions, strong atomicity, and a scalable multiprocessor implementation. Atomos is derived from Java, but replaces its synchronization and conditional waiting constructs with simpler ...
Revisiting software transactional memory in Haskell
Haskell '16Software Transactional Memory (STM) has become very popular in Haskell. Currently, there are nearly 500 packages on Haskell’s package archive that directly use STM. Despite the widespread use in real world applications, Haskell’s STM implementation has ...
Operation-Level Wait-Free Transactional Memory with Support for Irrevocable Operations
Transactional memory (TM) aims to be a general purpose concurrency mechanism. However, operations which cause side-effects cannot be easily managed by a TM system, in which transactions are executed optimistically. In particular, networking, I/O, and some ...
Comments