Protecting Locks Against Unbalanced Unlock()

被引:0
作者
Shahare, Vivek [1 ]
Chabbi, Milind [2 ]
Hegde, Nikhil [1 ]
机构
[1] Indian Inst Technol, Dharwad, Karnataka, India
[2] Uber Technol Inc, Programming Syst Grp, Sunnyvale, CA USA
来源
PROCEEDINGS OF THE 35TH ACM SYMPOSIUM ON PARALLELISM IN ALGORITHMS AND ARCHITECTURES, SPAA 2023 | 2023年
关键词
locks; threads; concurrency; unbalanced-unlock; synchronization; SYNCHRONIZATION; CONTENTION; ALGORITHMS; EFFICIENT;
D O I
10.1145/3558481.3591091
中图分类号
TP301 [理论、方法];
学科分类号
081202 ;
摘要
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.
引用
收藏
页码:199 / 211
页数:13
相关论文
共 78 条
  • [1] HPCTOOLKIT: tools for performance analysis of optimized parallel programs
    Adhianto, L.
    Banerjee, S.
    Fagan, M.
    Krentel, M.
    Marin, G.
    Mellor-Crummey, J.
    Tallent, N. R.
    [J]. CONCURRENCY AND COMPUTATION-PRACTICE & EXPERIENCE, 2010, 22 (06) : 685 - 701
  • [2] Anderson T. E., 1990, IEEE Transactions on Parallel and Distributed Systems, V1, P6, DOI 10.1109/71.80120
  • [3] [Anonymous], 2012, OSDI
  • [4] Auslander Marc A., 2002, US Patent, Patent No. 20030200457
  • [5] Bienia Christian, 2011, Benchmarking Modern Multiprocessors
  • [6] Foundations of the C plus plus Concurrency Memory Model
    Boehm, Hans-J.
    Adve, Sarita V.
    [J]. PLDI'08: PROCEEDINGS OF THE 2008 SIGPLAN CONFERENCE ON PROGRAMMING LANGUAGE DESIGN & IMPLEMENTATION, 2008, : 68 - 78
  • [7] Ownership types for safe programming: Preventing data races and deadlocks
    Boyapati, C
    Lee, R
    Rinard, M
    [J]. ACM SIGPLAN NOTICES, 2002, 37 (11) : 211 - 230
  • [8] Boyd-Wickizer Silas, 2012, P LIN S
  • [9] NUMA-Aware Reader-Writer Locks
    Calciu, Irina
    Dice, Dave
    Lev, Yossi
    Luchangco, Victor
    Marathe, Virendra J.
    Shavit, Nir
    [J]. ACM SIGPLAN NOTICES, 2013, 48 (08) : 157 - 166
  • [10] Efficient Abortable-locking Protocol for Multi-level NUMA Systems: Design and Correctness
    Chabbi, Milind
    Amer, Abdelhalim
    Liu, Xu
    [J]. ACM TRANSACTIONS ON PARALLEL COMPUTING, 2020, 7 (03)