An Ownership Policy and Deadlock Detector for Promises

01/05/2021
by   Caleb Voss, et al.
0

Task-parallel programs often enjoy deadlock freedom under certain restrictions, such as the use of structured join operations, as in Cilk and X10, or the use of asynchronous task futures together with deadlock-avoiding policies such as Known Joins or Transitive Joins. However, the promise, a popular synchronization primitive for parallel tasks, does not enjoy deadlock-freedom guarantees. Promises can exhibit deadlock-like bugs; however, the concept of a deadlock is not currently well-defined for promises. To address these challenges, we propose an ownership semantics in which each promise is associated to the task which currently intends to fulfill it. Ownership immediately enables the identification of bugs in which a task fails to fulfill a promise for which it is responsible. Ownership further enables the discussion of deadlock cycles among tasks and promises and allows us to introduce a robust definition of deadlock-like bugs for promises. Cycle detection in this context is non-trivial because it is concurrent with changes in promise ownership. We provide a lock-free algorithm for precise runtime deadlock detection. We show how to obtain the memory consistency criteria required for the correctness of our algorithm under TSO and the Java and C++ memory models. An evaluation compares the execution time and memory usage overheads of our detection algorithm on benchmark programs relative to an unverified baseline. Our detector exhibits a 12 time overhead and a 6 smaller overheads than in past approaches to deadlock cycle detection.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
07/21/2021

Decidability of Liveness on the TSO Memory Model

An important property of concurrent objects is whether they support prog...
research
07/19/2023

An Analysis of Bugs In Persistent Memory Application

Over the years of challenges on detecting the crash consistency of non-v...
research
08/09/2017

Safety Verification of Phaser Programs

We address the problem of statically checking control state reachability...
research
06/22/2017

A Study of Concurrency Bugs and Advanced Development Support for Actor-based Programs

The actor model is an attractive foundation for developing concurrent ap...
research
10/27/2019

Cilkmem: Algorithms for Analyzing the Memory High-Water Mark of Fork-Join Parallel Programs

Software engineers designing recursive fork-join programs destined to ru...
research
04/24/2023

Protecting Locks Against Unbalanced Unlock()

The lock is a building-block synchronization primitive that enables mutu...

Please sign up or login with your details

Forgot password? Click here to reset