Sound Automatic Lock Placement for Concurrent Programs with Pointers
Nicolas Waldburger, Florian Faissole, Ryo Okabe, Denis Cousineau
Abstract
We propose a lightweight method for automatic lock placement in concurrent POSIX programs with explicit pointer manipulation, such as C programs. Given a program that lacks sufficient user-placed mutexes, or contains none at all, our method introduces new mutexes to prevent data races. The method is formally proven to guarantee the absence of data races and mainly consists of three steps. The first step performs lockset analysis and may-happen-in-parallel analysis. The second step conducts a concurrent points-to analysis derived from a Steensgaard-like procedural analysis, where per-thread points-to graphs are unified using a special completion rule. The final step places locks to prevent data races while respecting a lock ordering to avoid deadlocks. In addition, user-annotated critical sections are protected through insertion of dedicated locks. Since lock placement is a complex and error-prone task, our method aims at helping developers write correct concurrent programs.
Create a lesson
Related papers
Coalgebra for True Concurrency
Shared title terminology · Yong Wang
Optimal Probabilistic Answer Set Programming: Complexity and Implementations
Shared title terminology · Damiano Azzolini, Giuseppe Mazzotta, Francesco Ricca et al.
Sundance: A Simple SMT Solver for Program Verification
Shared title terminology · Amar Shah, Benjamin F. Jones, Can Cebeci et al.
Propositional Dynamic Logic with Program Costs
Shared title terminology · Krishna Manoorkar, Wolfgang Poiger
Two Sides of the Same Proof: Extraction and Projection in Choreographic Programming
Shared title terminology · Matteo Acclavio, Giulia Manara, Fabrizio Montesi et al.
Deciding Scale Placement in MXFP4 Dot Products with Integer Arithmetic
Shared title terminology · Shreyas Vinayakumar