Abstract

Stateless Model Checking (SMC) is a verification technique for concurrent programs that checks for safety violations by exploring all possible thread interleavings. SMC is usually coupled with Partial Order Reduction (POR), which exploits the independence of instructions to avoid redundant explorations when an equivalent one has already been considered. While effective POR techniques have been developed for many different memory models, they are only able to exploit independence at the instruction level , which makes them unsuitable for programs with coarse-grained synchronization mechanisms such as locks . We present a lock-aware POR algorithm, LAPOR , that exploits independence at both instruction and critical section levels . This enables LAPOR to explore exponentially fewer interleavings than the state-of-the-art techniques for programs that use locks conservatively. Our algorithm is sound, complete, and optimal, and can be used for verifying programs under several different memory models. We implement LAPOR in a tool and show that it can be exponentially faster than the state-of-the-art model checkers.

Highlights

  • Coarse-grained locking (CGL) is the most widespread form of synchronization in concurrent sharedmemory programs

  • To make Stateless Model Checking (SMC) scalable for coarse-grained locking programs, we develop the Lock-Aware Partial Order Reduction (LAPOR) algorithm, which treats lock acquisitions in each program execution as independent unless their respective order can be deduced from the memory accesses of the execution

  • We note that since GenMC supports a Dynamic Partial Order Reduction (DPOR) algorithm that computes wb for ordering writes on the same memory location, we have instantiated LAPOR based on this DPOR with wb

Read more

Summary

Introduction

Coarse-grained locking (CGL) is the most widespread form of synchronization in concurrent sharedmemory programs. It is a fairly straightforward way of making a sequential program łthread-safež with programming languages, such as Java, even providing syntactic support for synchronizing all the methods operating on a shared object (regardless of whether they access the same fields of the object or not). CGL often performs better than finer-grained schemes in cases of low contention or when łhardware lock elisionž is available (e.g., on modern x86 processors). CGL simplifies reasoning about concurrent programs because it reduces the number of interleavings that a programmer or an automated verifier has to consider.

Methods
Results
Conclusion
Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call