ABSTRACT
Building applications that are responsive and can exploit parallel hardware while remaining simple to write, understand, test, and maintain, poses an important challenge for developers. In particular, it is often desirable to enable various tasks to read or modify shared data concurrently without requiring complicated locking schemes that may throttle concurrency and introduce bugs.
We introduce a mechanism that simplifies the parallel execution of different application tasks. Programmers declare what data they wish to share between tasks by using isolation types, and execute tasks concurrently by forking and joining revisions. These revisions are isolated: they read and modify their own private copy of the shared data only. A runtime creates and merges copies automatically, and resolves conflicts deterministically, in a manner declared by the chosen isolation type.
To demonstrate the practical viability of our approach, we developed an efficient algorithm and an implementation in the form of a C# library, and used it to parallelize an interactive game application. Our results show that the parallelized game, while simple and very similar to the original sequential game, achieves satisfactory speedups on a multicore processor.
- }}S. Aditya, Arvind, L. Augustsson, J.-W. Maessen, and R. Nikhil. Semantics of pH: A Parallel Dialect of Haskell. In Paul Hudak, editor, Proc. Haskell Workshop, La Jolla, CA USA, pages 35--49, June 1995.Google Scholar
- }}E. Allen, D. Chase, C. Flood, V. Luchangco, J.-W. Maessen, S. Ryu, and G. Steele Jr. Project fortress: A multicore language for multicore processors. In Linux Magazine, September 2007.Google Scholar
- }}A. Baldassin and S. Burckhardt. Lightweight software transactions for games. In Workshop on Hot Topics in Parallelism (HotPar), 2009. Google ScholarDigital 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 ScholarDigital Library
- }}T. Bergan, O. Anderson, J. Devietti, L. Ceze, and D. Grossman. Coredet: A compiler and runtime system for deterministic multithreaded execution. In Architectural Support for Programming Languages and Operating Systems (ASPLOS), 2010. Google ScholarDigital Library
- }}E. Berger, T. Yang, T. Liu, and G. Novark. Grace: Safe multithreaded programming for c/c++. In Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), 2009. Google ScholarDigital Library
- }}G. Blelloch, S. Chatterjee, J. Hardwick, J. Sipelstein, and M. Zagha. Implementation of a portable nested data-parallel language. Journal of Parallel and Distributed Computing, 21(1):4--14, April 1994. Google ScholarDigital Library
- }}C. Blundell, E. Lewis, and M. Martin. Deconstructing transactions: The subtleties of atomicity. In Workshop on Duplicating, Deconstructing, and Debunking (WDDD), 2005.Google Scholar
- }}R. Bocchino, V. Adve, D. Dig., S. Adve, S. Heumann, R. Komuravelli, J. Overbey, P. Simmons, H. Sung, and M. Vakilian. A type and effect system for deterministic parallel java. In Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), 2009. Google ScholarDigital Library
- }}S. Burckhardt and D. Leijen. Semantics of concurrent revisions (full version). Technical Report MSR-TR-2010-94, Microsoft, 2010.Google Scholar
- }}J. Danaher, I. Lee, and C. Leiserson. The jcilk language for multithreaded computing. In Synchronization and Concurrency in Object-Oriented Languages (SCOOL), San Diego, California, October 2005.Google Scholar
- }}J. Devietti, B. Lucia, L. Ceze, and M. Oskin. DMP: Deterministic shared-memory multiprocessing. Micro, IEEE, 30(1):40--49, jan.-feb. 2010. Google ScholarDigital Library
- }}C. Flanagan and M. Felleisen. The semantics of future and its use in program optimization. In Rice University, pages 209--220, 1995. Google ScholarDigital Library
- }}M. Frigo, P. Halpern, C. E. Leiserson, and S. Lewin-Berlin. Reducers and other cilk++ hyperobjects. In Symposium on Parallel Algorithms and Architectures (SPAA), pages 79--90, 2009. Google ScholarDigital Library
- }}M. Frigo, C. Leiserson, and K. Randall. The implementation of the Cilk-5 multithreaded language. In Programming Language Design and Implementation (PLDI), pages 212--223. ACM, 1998. Google ScholarDigital Library
- }}T. Harris, A. Cristal, O. Unsal, E. Ayguadé, F. Gagliardi, B. Smith, and M. Valero. Transactional memory: An overview. IEEE Micro, 27(3):8--29, 2007. Google ScholarDigital Library
- }}E. Hatton, A. S. Lobao, and D. Weller. Beginning .NET Game Programming in C#. Apress, 2004. Google ScholarDigital 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 ScholarDigital Library
- }}M. Herlihy and J. Wing. Linearizability: a correctness condition for concurrent objects. ACM Trans. Program. Lang. Syst., 12(3):463--492, 1990. Google ScholarDigital Library
- }}E. Koskinen, M. Parkinson, and M. Herlihy. Coarse-grained transactions. In Principles of Programming Languages (POPL), pages 19--30, 2010. Google ScholarDigital Library
- }}M. Kulkarni, K. Pingali, B. Walter, G. Ramanarayanan, K. Bala, and L. Chew. Optimistic parallelism requires abstractions. In Programming Language Design and Impl. (PLDI), 2007. Google ScholarDigital Library
- }}J. Larus and R. Rajwar. Transactional Memory. Morgan & Claypool Publishers, 2007.Google Scholar
- }}D. Lea. A java fork/join framework. In Java Grande, pages 36--43, 2000. Google ScholarDigital Library
- }}D. Lee, B. Wester, K. Veeraraghavan, S. Narayanasamy, P. Chen, and J. Flinn. Respec: Efficient online multiprocessor replay via speculation and external determinism. In Architectural Support for Programming Languages and Operating Systems (ASPLOS), 2010. Google ScholarDigital Library
- }}J. Lee and J. Palsberg. Featherweight x10: a core calculus for async-finish parallelism. In Principles and Practice of Parallel Programming (PPoPP), 2010. Google ScholarDigital Library
- }}D. Leijen, W. Schulte, and S. Burckhardt. The design of a task parallel library. In Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), 2009. Google ScholarDigital Library
- }}A. Martin, A. Birrell, T. Harris, and M. Isard. Semantics of transactional memory and automatic mutual exclusion. In Principles of Programming Languages (POPL), pages 63--74, 2008. Google ScholarDigital Library
- }}Microsoft. Parallel extensions to .NET. http://msdn.microsoft.com/en-us/concurrency, June 2009.Google Scholar
- }}L. Moreau. The semantics of scheme with future. In In In ACM SIGPLAN International Conference on Functional Programming (ICFP'96, pages 146--156, 1996. Google ScholarDigital Library
- }}P.A.Bernstein and N.Goodman. Multiversion concurrency control-theory and algorithms. ACM Trans. Database Syst., 8(4):465--483, 1983. Google ScholarDigital Library
- }}P.A.Bernstein, V.Hadzilacos, and N.Goodman. Concurrency Control and Recovery in Database Systems. Addison-Wesley, 1987. Google ScholarDigital Library
- }}P. Pratikakis, J. Spacco, and M. Hicks. Transparent proxies for java futures. SIGPLAN Not., 39(10):206--223, 2004. Google ScholarDigital Library
- }}K. Randall. Cilk: Efficient Multithreaded Computing. PhD thesis, Department of Electrical Engineering and Computer Science, Massachusetts Institute of Technology, May 1998. Google ScholarDigital Library
- }}T. Riegel, C. Fetzer, and P. Felber. Snapshot isolation for software transactional memory. In Workshop on Transactional Computing (TRANSACT), 2006.Google Scholar
- }}M. Rinard and P. Diniz. Eliminating synchronization bottlenecks in object-based programs using adaptive replication. In International Conference on Supercomputing, 1999. Google ScholarDigital Library
- }}V. Saraswat, V. Sarkar, and C. von Praun. X10: concurrent programming for modern architectures. In Principles and Practice of Parallel Programming (PPoPP), 2007. Google ScholarDigital Library
- }}G. Steele. Parallel programming and parallel abstractions in fortress. In Invited talk at the Eighth International Symposium on Functional and Logic Programming (FLOPS), April 2006. Google ScholarDigital Library
- }}A. Welc, S. Jagannathan, and A. Hosking. Safe futures for java. In Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), pages 439--453, 2005. Google ScholarDigital Library
- }}A. Welc, B. Saha, and A.-R. Adl-Tabatabai. Irrevocable transactions and their applications. In Symposium on Parallel Algorithms and Architectures (SPAA), pages 285--296, 2008. Google ScholarDigital Library
Index Terms
- Concurrent programming with revisions and isolation types
Recommendations
Concurrent programming with revisions and isolation types
OOPSLA '10Building applications that are responsive and can exploit parallel hardware while remaining simple to write, understand, test, and maintain, poses an important challenge for developers. In particular, it is often desirable to enable various tasks to ...
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 ...
A critique of snapshot isolation
EuroSys '12: Proceedings of the 7th ACM european conference on Computer SystemsThe support for transactions is an essential part of a database management system (DBMS). Without this support, the developers are burdened with ensuring atomic execution of a transaction despite failures as well as concurrent accesses to the database ...
Comments