Data Race Freedom à la Mode
Aïna Linn Georges, Benjamin Peters, Laila Elbeheiry, Leo White, Stephen Dolan, Richard A. Eisenberg, Chris Casinghino, François Pottier, Derek Dreyer
Abstract
We present DRFCaml, an extension of OCaml’s type system that guarantees data race freedom for multithreaded OCaml programs while retaining backward compatibility with existing sequential OCaml code. We build on recent work of Lorenzen et al., who extend OCaml with modes that keep track of locality, uniqueness, and affinity. We introduce two new mode axes, contention and portability , which record whether data has been shared or can be shared between multiple threads. Although this basic type-and-mode system has limited expressive power by itself, it does let us express APIs for capsules , regions of memory whose access is controlled by a unique ghost key, and reader-writer locks , which allow a thread to safely acquire partial or full ownership of a key. We show that this allows complex data structures (which may involve aliasing and mutable state) to be safely shared between threads. We formalize the complete system and establish its soundness by building a semantic model of it in the Iris program logic on top of the Rocq proof assistant.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 7e6cfd8f-2a1f-4c2c-a20f-3ba06264233cCited by top-tier papers4
- Dynamic Region Ownership for Concurrency SafetyFridtjof Peer Stoldt, Gary Brandt Bucher II, Sylvan Clebsch, Matthew A. Johnson et al.PLDI 2025 · 4 citations
- Zoo: A Framework for the Verification of Concurrent OCaml 5 Programs using Separation LogicClément Allain, Gabriel SchererPOPL 2026 · 2 citations
- TypeDis: A Type System for DisentanglementAlexandre Moine, Stephanie Balzer, Alex Xu, Sam WestrickPOPL 2026 · 1 citation
- Pure Borrow: Linear Haskell Meets Rust-Style BorrowingYusuke Matsushita, Hiromi IshiiPLDI 2026
Builds on6
- Reachability types: tracking aliasing and separation in higher-order functional programsYuyan Bao, Guannan Wei, Oliver Bracevac, Yuxuan Jiang et al.OOPSLA 2021 · 19 citations
- Reference Capabilities for Flexible Memory ManagementEllen Arvidsson, Elias Castegren, Sylvan Clebsch, Sophia Drossopoulou et al.OOPSLA 2023 · 17 citations
- A flexible type system for fearless concurrencyMae Milano, Joshua Turcotti, Andrew C. MyersPLDI 2022 · 14 citations
- Polymorphic Reachability Types: Tracking Freshness, Aliasing, and Separation in Higher-Order Generic ProgramsGuannan Wei, Oliver Bracevac, Songlin Jia, Yuyan Bao et al.POPL 2024 · 12 citations
- When Concurrency Matters: Behaviour-Oriented ConcurrencyLuke Cheeseman, Matthew J. Parkinson, Sylvan Clebsch, Marios Kogias et al.OOPSLA 2023 · 9 citations
Related papers
- Backwards-Compatible Row-Based Exceptions in MLSimcha van Collem, Paulo Emílio de Vilhena, Robbert KrebbersPLDI 2026
- Checking Data-Race Freedom of GPU Kernels, CompositionallyTiago Cogumbreiro, Julien Lange, Dennis Liew Zhen Rong, Hannah ZicarelliCAV 2021 · 17 citations
- Degrees of Separation: A Flexible Type System for Safe ConcurrencyYichen Xu, Aleksander Boruch-Gruszecki, Martin OderskyOOPSLA 2024 · 6 citations
- Le temps des cerises: efficient temporal stack safety on capability machines using directed capabilitiesAïna Linn Georges, Alix Trieu, Lars BirkedalOOPSLA 2022 · 17 citations
- Melocoton: A Program Logic for Verified Interoperability Between OCaml and CArmaël Guéneau, Johannes Hostert, Simon Spies, Michael Sammler et al.OOPSLA 2023 · 10 citations
