Degrees of Separation: A Flexible Type System for Data Race Prevention

08/14/2023
by   Yichen Xu, et al.
0

Data races are a notorious problem in parallel programming. There has been great research interest in type systems that statically prevent data races. Despite the progress in the safety and usability of these systems, lots of existing approaches enforce strict anti-aliasing principles to prevent data races. The adoption of them is often intrusive, in the sense that it invalidates common programming patterns and requires paradigm shifts. We propose Capture Separation Calculus (System CSC), a calculus based on Capture Calculus (System CC<:box), that achieves static data race freedom while being non-intrusive. It allows aliasing in general to permit common programming patterns, but tracks aliasing and controls them when that is necessary to prevent data races. We study the formal properties of System CSC by establishing its type safety and data race freedom. Notably, we establish the data race freedom property by proving the confluence of its reduction semantics. To validate the usability of the calculus, we implement it as an extension to the Scala 3 compiler, and use it to type-check the examples in the paper.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
09/15/2021

Dala: A Simple Capability-Based Dynamic Language Design For Data Race-Freedom

Dynamic languages like Erlang, Clojure, JavaScript, and E adopted data-r...
research
09/11/2023

A Mechanized Theory of the Box Calculus

The capture calculus is an extension of System F<: that tracks free vari...
research
09/13/2023

Using Pi-Calculus Names as Locks

Locks are a classic data structure for concurrent programming. We introd...
research
06/10/2023

Formalizing Box Inference for Capture Calculus

Capture calculus has recently been proposed as a solution to effect chec...
research
12/12/2021

A simple proof of three properties on Simpson's 4-slot Algorithm

In this paper we present an invariance proof of three properties on Simp...
research
07/07/2022

Scoped Capabilities for Polymorphic Effects

Type systems usually characterize the shape of values but not their free...
research
06/23/2021

Fuel: A Compiler Framework for Safe Memory Management

Flow-sensitive type systems offer an elegant way to ensure memory-safety...

Please sign up or login with your details

Forgot password? Click here to reset