Protecting Locks Against Unbalanced Unlock()

04/24/2023
by   Vivek Shahare, et al.
0

The lock is a building-block synchronization primitive that enables mutually exclusive access to shared data in shared-memory parallel programs. Mutual exclusion is typically achieved by guarding the code that accesses the shared data with a pair of lock() and unlock() operations. Concurrency bugs arise when this ordering of operations is violated. In this paper, we study a particular pattern of misuse where an unlock() is issued without first issuing a lock(), which can happen in code with complex control flow. This misuse is surprisingly common in several important open-source repositories we study. We systematically study what happens due to this misuse in several popular locking algorithms. We study how misuse can be detected and how the locking protocols can be fixed to avoid the unwanted consequences of misuse. Most locks require simple changes to detect and prevent this misuse. We evaluate the performance traits of modified implementations, which show mild performance penalties in most scalable locks.

READ FULL TEXT

page 11

page 15

research
03/27/2018

Safe Non-blocking Synchronization in Ada 202x

The mutual-exclusion property of locks stands in the way to scalability ...
research
12/01/2021

Common Bugs in Scratch Programs

Bugs in Scratch programs can spoil the fun and inhibit learning success....
research
07/17/2023

Fast Shared-Memory Barrier Synchronization for a 1024-Cores RISC-V Many-Core Cluster

Synchronization is likely the most critical performance killer in shared...
research
03/29/2021

SafeDrop: Detecting Memory Deallocation Bugs of Rust Programs via Static Data-Flow Analysis

Rust is an emerging programming language that aims to prevent memory-saf...
research
01/05/2021

An Ownership Policy and Deadlock Detector for Promises

Task-parallel programs often enjoy deadlock freedom under certain restri...
research
10/31/2017

Beyond Shared Hierarchies: Deep Multitask Learning through Soft Layer Ordering

Existing deep multitask learning (MTL) approaches align layers shared be...
research
09/16/2018

Low synchronization GMRES algorithms

Communication-avoiding and pipelined variants of Krylov solvers are crit...

Please sign up or login with your details

Forgot password? Click here to reset