[go: up one dir, main page]
More Web Proxy on the site http://driver.im/ skip to main content
research-article
Open access

Virtual machine design for parallel dynamic programming languages

Published: 24 October 2018 Publication History

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.

Supplementary Material

WEBM File (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.
[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.
[3]
Joe Armstrong. 2010. Erlang. Commun. ACM 53, 9 (Sept. 2010), 68–75.
[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.
[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.
[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.
[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.
[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.
[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.
[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.
[11]
Alan Dearle. 1988. On the Construction of Persistent Programming Environments. Ph.D. Dissertation. AAIDX86382.
[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.
[13]
IronPython. 2018. The IronPython Project. http://ironpython.net/.
[14]
JRuby. 2018. Concurrency in JRuby. https://github.com/jruby/jruby/wiki/Concurrency-in-jruby.
[15]
Jython. 2018. Jython Concurrency. http://www.jython.org/jythonbook/en/1.0/Concurrency.html.
[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
[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.
[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.
[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.
[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.
[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.
[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.
[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.
[24]
PyPy. 2018. PyPy Benchmarks on Bitbucket. https://bitbucket.org/pypy/benchmarks.
[25]
Python Software Foundation. 2018. Python FAQ. https://docs.python.org/2/faq/library.html#what-kinds-of-global-valuemutation-are-thread-safe.
[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.
[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.
[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.
[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.
[30]
Laurence Tratt. 2009. Dynamically Typed Languages. Advances in Computers 77, Jul (2009), 149–184.
[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.
[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.
[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.

Cited By

View all
  • (2024)Multi-threaded OpenSmalltalk VM: Choosing a Strategy for ParallelizationCompanion Proceedings of the 8th International Conference on the Art, Science, and Engineering of Programming10.1145/3660829.3660846(87-93)Online publication date: 11-Mar-2024
  • (2023)EVMTracer: Dynamic Analysis of the Parallelization and Redundancy Potential in the Ethereum Virtual MachineIEEE Access10.1109/ACCESS.2023.326727711(47159-47178)Online publication date: 2023
  • (2022)Virtual Machine Resource Allocation Optimization in Cloud Computing Based on Multiobjective Genetic AlgorithmComputational Intelligence and Neuroscience10.1155/2022/78731312022Online publication date: 1-Jan-2022

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image Proceedings of the ACM on Programming Languages
Proceedings of the ACM on Programming Languages  Volume 2, Issue OOPSLA
November 2018
1656 pages
EISSN:2475-1421
DOI:10.1145/3288538
Issue’s Table of Contents
This work is licensed under a Creative Commons Attribution International 4.0 License.

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 24 October 2018
Published in PACMPL Volume 2, Issue OOPSLA

Permissions

Request permissions for this article.

Check for updates

Badges

Author Tags

  1. dynamic language
  2. parallel execution
  3. virtual machine

Qualifiers

  • Research-article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)189
  • Downloads (Last 6 weeks)25
Reflects downloads up to 09 Jan 2025

Other Metrics

Citations

Cited By

View all
  • (2024)Multi-threaded OpenSmalltalk VM: Choosing a Strategy for ParallelizationCompanion Proceedings of the 8th International Conference on the Art, Science, and Engineering of Programming10.1145/3660829.3660846(87-93)Online publication date: 11-Mar-2024
  • (2023)EVMTracer: Dynamic Analysis of the Parallelization and Redundancy Potential in the Ethereum Virtual MachineIEEE Access10.1109/ACCESS.2023.326727711(47159-47178)Online publication date: 2023
  • (2022)Virtual Machine Resource Allocation Optimization in Cloud Computing Based on Multiobjective Genetic AlgorithmComputational Intelligence and Neuroscience10.1155/2022/78731312022Online publication date: 1-Jan-2022

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Login options

Full Access

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media