Optimal Reads-From Consistency Checking for C11-Style Memory Models

04/07/2023
by   Hunkar Can Tunc, et al.
0

Over the years, several memory models have been proposed to capture the subtle concurrency semantics of C/C++.One of the most fundamental problems associated with a memory model M is consistency checking: given an execution X, is X consistent with M? This problem lies at the heart of numerous applications, including specification testing and litmus tests, stateless model checking, and dynamic analyses. As such, it has been explored extensively and its complexity is well-understood for traditional models like SC and TSO. However, less is known for the numerous model variants of C/C++, for which the problem becomes challenging due to the intricacies of their concurrency primitives. In this work we study the problem of consistency checking for popular variants of the C11 memory model, in particular, the RC20 model, its release-acquire (RA) fragment, the strong and weak variants of RA (SRA and WRA), as well as the Relaxed fragment of RC20. Motivated by applications in testing and model checking, we focus on reads-from consistency checking. The input is an execution X specifying a set of events, their program order and their reads-from relation, and the task is to decide the existence of a modification order on the writes of X that makes X consistent in a memory model. We draw a rich complexity landscape for this problem; our results include (i) nearly-linear-time algorithms for certain variants, which improve over prior results, (ii) fine-grained optimality results, as well as (iii) matching upper and lower bounds (NP-hardness) for other variants. To our knowledge, this is the first work to characterize the complexity of consistency checking for C11 memory models. We have implemented our algorithms inside the TruSt model checker and the C11Tester testing tool. Experiments on standard benchmarks show that our new algorithms improve consistency checking, often by a significant margin.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
07/21/2020

A Framework for Consistency Algorithms

We present a framework that provides deterministic consistency algorithm...
research
05/15/2018

Parameterized Model Checking Modulo Explicit Weak Memory Models

We present a modular framework for model checking parameterized array-ba...
research
05/04/2015

Dynamic Consistency of Conditional Simple Temporal Networks via Mean Payoff Games: a Singly-Exponential Time DC-Checking

Conditional Simple Temporal Network (CSTN) is a constraint-based graph-f...
research
11/23/2020

The Reads-From Equivalence for the TSO and PSO Memory Models

The verification of concurrent programs remains an open challenge due to...
research
10/13/2017

The Semantics of Transactions and Weak Memory in x86, Power, ARMv8, and C++

Weak memory models trade programmability for performance, while transact...
research
08/02/2018

Optimal Stateless Model Checking under the Release-Acquire Semantics

We present a framework for efficient application of stateless model chec...
research
05/21/2020

Repairing and Mechanising the JavaScript Relaxed Memory Model

Modern JavaScript includes the SharedArrayBuffer feature, which provides...

Please sign up or login with your details

Forgot password? Click here to reset