skip to main content
research-article

Concurrent programming with revisions and isolation types

Published:17 October 2010Publication History
Skip Abstract Section

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.

References

  1. }}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 ScholarGoogle Scholar
  2. }}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 ScholarGoogle Scholar
  3. }}A. Baldassin and S. Burckhardt. Lightweight software transactions for games. In Workshop on Hot Topics in Parallelism (HotPar), 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. }}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
  5. }}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 ScholarGoogle ScholarDigital LibraryDigital Library
  6. }}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 ScholarGoogle ScholarDigital LibraryDigital Library
  7. }}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 ScholarGoogle ScholarDigital LibraryDigital Library
  8. }}C. Blundell, E. Lewis, and M. Martin. Deconstructing transactions: The subtleties of atomicity. In Workshop on Duplicating, Deconstructing, and Debunking (WDDD), 2005.Google ScholarGoogle Scholar
  9. }}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 ScholarGoogle ScholarDigital LibraryDigital Library
  10. }}S. Burckhardt and D. Leijen. Semantics of concurrent revisions (full version). Technical Report MSR-TR-2010-94, Microsoft, 2010.Google ScholarGoogle Scholar
  11. }}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 ScholarGoogle Scholar
  12. }}J. Devietti, B. Lucia, L. Ceze, and M. Oskin. DMP: Deterministic shared-memory multiprocessing. Micro, IEEE, 30(1):40--49, jan.-feb. 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. }}C. Flanagan and M. Felleisen. The semantics of future and its use in program optimization. In Rice University, pages 209--220, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. }}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 ScholarGoogle ScholarDigital LibraryDigital Library
  15. }}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 ScholarGoogle ScholarDigital LibraryDigital Library
  16. }}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 ScholarGoogle ScholarDigital LibraryDigital Library
  17. }}E. Hatton, A. S. Lobao, and D. Weller. Beginning .NET Game Programming in C#. Apress, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. }}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
  19. }}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
  20. }}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
  21. }}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 ScholarGoogle ScholarDigital LibraryDigital Library
  22. }}J. Larus and R. Rajwar. Transactional Memory. Morgan & Claypool Publishers, 2007.Google ScholarGoogle Scholar
  23. }}D. Lea. A java fork/join framework. In Java Grande, pages 36--43, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. }}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 ScholarGoogle ScholarDigital LibraryDigital Library
  25. }}J. Lee and J. Palsberg. Featherweight x10: a core calculus for async-finish parallelism. In Principles and Practice of Parallel Programming (PPoPP), 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. }}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 ScholarGoogle ScholarDigital LibraryDigital Library
  27. }}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 ScholarGoogle ScholarDigital LibraryDigital Library
  28. }}Microsoft. Parallel extensions to .NET. http://msdn.microsoft.com/en-us/concurrency, June 2009.Google ScholarGoogle Scholar
  29. }}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 ScholarGoogle ScholarDigital LibraryDigital Library
  30. }}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
  31. }}P.A.Bernstein, V.Hadzilacos, and N.Goodman. Concurrency Control and Recovery in Database Systems. Addison-Wesley, 1987. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. }}P. Pratikakis, J. Spacco, and M. Hicks. Transparent proxies for java futures. SIGPLAN Not., 39(10):206--223, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. }}K. Randall. Cilk: Efficient Multithreaded Computing. PhD thesis, Department of Electrical Engineering and Computer Science, Massachusetts Institute of Technology, May 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. }}T. Riegel, C. Fetzer, and P. Felber. Snapshot isolation for software transactional memory. In Workshop on Transactional Computing (TRANSACT), 2006.Google ScholarGoogle Scholar
  35. }}M. Rinard and P. Diniz. Eliminating synchronization bottlenecks in object-based programs using adaptive replication. In International Conference on Supercomputing, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. }}V. Saraswat, V. Sarkar, and C. von Praun. X10: concurrent programming for modern architectures. In Principles and Practice of Parallel Programming (PPoPP), 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. }}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 ScholarGoogle ScholarDigital LibraryDigital Library
  38. }}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 ScholarGoogle ScholarDigital LibraryDigital Library
  39. }}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 ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Concurrent programming with revisions and isolation types

        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

        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!