skip to main content

Virtual machine design for parallel dynamic programming languages

Published:24 October 2018Publication History
Skip Abstract Section

Abstract

To leverage the benefits of modern hardware, dynamic languages must support parallelism, and parallelism requires a virtual machine (VM) capable of parallel execution — a parallel VM. However, unrestricted concurrency and the dynamism of dynamic languages pose great challenges to the implementation of parallel VMs. In a dynamic language, a program changing itself is part of the language model. To help the VM, languages often choose memory models (MM) that weaken consistency guarantees. With lesser guarantees, local program state cannot be affected by every concurrent state change. And less interference allows a VM to make local assumptions about the program state which are not immediately violated. These local assumptions are essential for a VM’s just-in-time compiler for delivering state-of-the-art VM performance.

Unfortunately, some dynamic languages employ MMs that give exceedingly strong consistency guarantees and thereby hinder the development of parallel VMs. Such is the case in particular for languages that depend on a global interpreter lock, which mandates a MM with sequential consistency and instruction atomicity.

In this paper, we reflect on a first implementation of the Parallel RPython execution model, which facilitates the development of parallel VMs by decoupling language semantics from the synchronization mechanism used within the VM. The implementation addresses the challenges imposed by strong MMs through strict isolation of concurrent computations. This isolation builds on transactional parallel worlds, which are implemented with a novel combination of software techniques and the capabilities of modern hardware.

We evaluate a set of parallel Python programs on a parallel VM that relies on Parallel RPython’s implementation. Compared with a serial baseline VM that relies on a global interpreter lock, the parallel VM achieves speedups of up to 7.5× on 8 CPU cores. The evaluation shows that our realization of Parallel RPython meets the challenges of dynamic languages, and that it can serve as a solid foundation for the construction of parallel dynamic language VMs.

Skip Supplemental Material Section

Supplemental Material

a109-meier.webm

References

  1. Martín Abadi, Tim Harris, and Mojtaba Mehrara. 2009. Transactional Memory with Strong Atomicity Using Off-the-Shelf Memory Protection Hardware. In Proceedings of the 14th ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming (PPoPP ’09) . ACM, New York, NY, USA, 185–196. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Antonio Albano, Luca Cardelli, and Renzo Orsini. 1985. GALILEO: A Strongly-typed, Interactive Conceptual Language. ACM Trans. Database Syst. 10, 2 (June 1985), 230–260. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Joe Armstrong. 2010. Erlang. Commun. ACM 53, 9 (Sept. 2010), 68–75. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Malcolm Atkinson, Ken Chisholm, and Paul Cockshott. 1982. PS-algol: An Algol with a Persistent Heap. SIGPLAN Not. 17, 7 (July 1982), 24–31. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Carl Friedrich Bolz, Antonio Cuni, Maciej Fijalkowski, and Armin Rigo. 2009. Tracing the Meta-Level: PyPy’s Tracing JIT Compiler. In Proceedings of the 4th Workshop on the Implementation, Compilation, Optimization of Object-Oriented Languages and Programming Systems (ICOOOLPS ’09) . ACM, New York, NY, USA, 18–25. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Calin Cascaval, Colin Blundell, Maged Michael, Harold W. Cain, Peng Wu, Stefanie Chiras, and Siddhartha Chatterjee. 2008. Software Transactional Memory: Why Is It Only a Research Toy? Queue 6, 5 (Sept. 2008), 40:46–40:58. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Craig Chambers, David Ungar, and Elgin Lee. 1989. An Efficient Implementation of SELF a Dynamically-Typed ObjectOriented Language Based on Prototypes. In Conference Proceedings on Object-Oriented Programming Systems, Languages and Applications (OOPSLA ’89) . ACM, New York, NY, USA, 49–70. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Luke Dalessandro, Dave Dice, Michael Scott, Nir Shavit, and Michael Spear. 2010. Transactional Mutex Locks. In Euro-Par 2010 - Parallel Processing (Lecture Notes in Computer Science) . Springer, Berlin, Heidelberg, 2–13. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Benoit Daloze, Stefan Marr, Daniele Bonetta, and Hanspeter Mössenböck. 2016. Efficient and Thread-Safe Objects for Dynamically-Typed Languages. In Proceedings of the 2016 ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA 2016) . ACM, New York, NY, USA, 642–659. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Benoit Daloze, Arie Tal, Stefan Marr, Hanspeter Mössenböck, and Erez Petrank. 2018. Parallelization of Dynamic Languages: Synchronizing Built-in Collections. In Proceedings of the 2018 ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA 2018) . ACM.Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Alan Dearle. 1988. On the Construction of Persistent Programming Environments. Ph.D. Dissertation. AAIDX86382. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Aleksandar Dragojević, Pascal Felber, Vincent Gramoli, and Rachid Guerraoui. 2011. Why STM Can Be More Than a Research Toy. Commun. ACM 54, 4 (April 2011), 70–77. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. IronPython. 2018. The IronPython Project. http://ironpython.net/.Google ScholarGoogle Scholar
  14. JRuby. 2018. Concurrency in JRuby. https://github.com/jruby/jruby/wiki/Concurrency-in-jruby.Google ScholarGoogle Scholar
  15. Jython. 2018. Jython Concurrency. http://www.jython.org/jythonbook/en/1.0/Concurrency.html.Google ScholarGoogle Scholar
  16. Robert R. Kessler and Mark R. Swanson. 1990. Concurrent Scheme. In Proceedings of the US/Japan Workshop on Parallel Lisp: Languages and Systems . Springer-Verlag, Berlin, Heidelberg, 200–234. http://dl.acm.org/citation.cfm?id=646454.693125 Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Johann M. Kraus and Hans A. Kestler. 2009. Multi-core Parallelization in Clojure: A Case Study. In Proceedings of the 6th European Lisp Workshop (ELW ’09) . ACM, New York, NY, USA, 8–17. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Jochen Liedtke. 1993. A persistent system in real use — experiences of the first 13 years. In Proceedings of the Third International Workshop on Object Orientation in Operating Systems . IEEE, 2–11.Google ScholarGoogle ScholarCross RefCross Ref
  19. Yu David Liu, Xiaoqi Lu, and Scott F. Smith. 2008. Coqa: Concurrent Objects with Quantized Atomicity. In Proceedings of the Joint European Conferences on Theory and Practice of Software 17th International Conference on Compiler Construction (CC’08/ETAPS’08) . Springer-Verlag, Berlin, Heidelberg, 260–275. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Cristian Mattarei, Clark Barrett, Shu-yu Guo, Bradley Nelson, and Ben Smith. 2018. EMME: A Formal Tool for ECMAScript Memory Model Evaluation. In Tools and Algorithms for the Construction and Analysis of Systems, Dirk Beyer and Marieke Huisman (Eds.). Springer International Publishing, Cham, 55–71.Google ScholarGoogle Scholar
  21. Remigius Meier, Armin Rigo, and Thomas R. Gross. 2016. Parallel Virtual Machines with RPython. In Proceedings of the 12th Symposium on Dynamic Languages (DLS 2016) . ACM, New York, NY, USA, 48–59. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Dushyanth Narayanan and Orion Hodson. 2012. Whole-system Persistence. In Proceedings of the Seventeenth International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS XVII) . ACM, New York, NY, USA, 401–410. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Rei Odaira, Jose G. Castanos, and Hisanobu Tomari. 2014. Eliminating Global Interpreter Locks in Ruby Through Hardware Transactional Memory. In Proceedings of the 19th ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming (PPoPP ’14) . ACM, New York, NY, USA, 131–142. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. PyPy. 2018. PyPy Benchmarks on Bitbucket. https://bitbucket.org/pypy/benchmarks.Google ScholarGoogle Scholar
  25. Python Software Foundation. 2018. Python FAQ. https://docs.python.org/2/faq/library.html#what-kinds-of-global-valuemutation-are-thread-safe.Google ScholarGoogle Scholar
  26. Armin Rigo and Samuele Pedroni. 2006. PyPy’s Approach to Virtual Machine Construction. In Companion to the 21st ACM SIGPLAN Symposium on Object-Oriented Programming Systems, Languages, and Applications (OOPSLA ’06) . ACM, New York, NY, USA, 944–953. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Nicholas Riley and Craig Zilles. 2006. Hardware Transactional Memory Support for Lightweight Dynamic Language Evolution. In Companion to the 21st ACM SIGPLAN Symposium on Object-Oriented Programming Systems, Languages, and Applications (OOPSLA ’06) . ACM, New York, NY, USA, 998–1008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. James Swaine, Kevin Tew, Peter Dinda, Robert Bruce Findler, and Matthew Flatt. 2010. Back to the Futures: Incremental Parallelization of Existing Sequential Runtime Systems. In Proceedings of the ACM International Conference on Object Oriented Programming Systems Languages and Applications (OOPSLA ’10) . ACM, New York, NY, USA, 583–597. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Fuad Tabba. 2010. Adding Concurrency in Python Using a Commercial Processor’s Hardware Transactional Memory Support. SIGARCH Comput. Archit. News 38, 5 (April 2010), 12–19. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Laurence Tratt. 2009. Dynamically Typed Languages. Advances in Computers 77, Jul (2009), 149–184.Google ScholarGoogle ScholarCross RefCross Ref
  31. Jons-Tobias Wamhoff, Christof Fetzer, Pascal Felber, Etienne Rivière, and Gilles Muller. 2013. FastLane: Improving Performance of Software Transactional Memory for Low Thread Counts. In Proceedings of the 18th ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming (PPoPP ’13) . ACM, New York, NY, USA, 113–122. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. Christian Wimmer and Thomas Würthinger. 2012. Truffle: A Self-Optimizing Runtime System. In Proceedings of the 3rd Annual Conference on Systems, Programming, and Applications: Software for Humanity (SPLASH ’12) . ACM, New York, NY, USA, 13–14. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. Thomas Würthinger, Andreas Wöß, Lukas Stadler, Gilles Duboscq, Doug Simon, and Christian Wimmer. 2012. Self-optimizing AST Interpreters. In Proceedings of the 8th Symposium on Dynamic Languages (DLS ’12). ACM, New York, NY, USA, 73–82. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Virtual machine design for parallel dynamic programming languages

      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!