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.

Highlights

  • Virtual machines (VMs) that allow the execution of parallel shared-memory programs are difficult to develop

  • Additional restrictions for the design of a synchronization mechanism come from the functionality that dynamic languages offer to programmers. We present these requirements and constraints and show how they are addressed by the design of a Software Transactional Memory (STM) system

  • We evaluate the STM system as the runtime of a parallel Python VM

Read more

Summary

Introduction

Virtual machines (VMs) that allow the execution of parallel shared-memory programs are difficult to develop. One reason is that these languages lack, or lacked for a long time, a memory model suited to parallel execution Instead of introducing such a memory model when concurrent execution became a necessity, Python and Ruby introduced a single global lock within the VM to serialize the execution of multiple threads. This Global Interpreter Lock (GIL) prevents true parallel execution and, as a byproduct, gives strong guarantees, such as sequential consistency and atomicity for certain operations [Python Software Foundation 2018].

Methods
Results
Conclusion
Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call