Dynamic Region Ownership for Concurrency Safety - Stoldt, Fridtjof Peer; Bucher, Brandt; Clebsch, Sylvan; Johnson, Matthew; Parkinson, Matthew J.; Rossum, Guido Van; Snow, Eric; Wrigstad, Tobias (PACMPL, 2025)
When a program, or programming language, graduates from sequential to concurrent execution it can be a painful process. The ways in which the components of a program interact with each other in a concurrent setting can be considerably more complex than in a sequential setting. The core problem is unrestricted shared mutable state. An alternative to unrestricted shared mutable state is to restrict the sharing using Ownership. Ownership can turn what would have been a race into a deterministic failure that can be explained to the programmer. However, Ownership has predominantly taken place in statically typed languages. In this paper, we explore retrofitting an existing dynamically typed programming language with an ownership model based on regions. Our core aim is to provide safe concurrency, that is, the ownership model should provide deterministic dynamic failures of ownership that can be explained to the programmer. We present a dynamic model of ownership that provides ownership of groups objects called regions. We provide dynamic enforcement of our region discipline, which we have implemented in a simple interpreter that provides a Python-like syntax and semantics, and report on our first steps into integrating it into an existing language, Python.