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 条
  • [71] Wang A, 2012, INT CONFER PARA, P127
  • [72] Be my guest: MCS lock now welcomes guests
    Wang, Tianzheng
    Chabbi, Milind
    Kimura, Hideaki
    [J]. ACM SIGPLAN NOTICES, 2016, 51 (08) : 251 - 262
  • [73] Webb Shawn, 2018, glibc pthread mutex lock
  • [74] WOO SC, 1995, ACM COMP AR, P24, DOI 10.1109/ISCA.1995.524546
  • [75] YANG JH, 1995, DISTRIB COMPUT, V9, P51, DOI 10.1007/BF01784242
  • [76] Performance Evaluation of Intel® Transactional Synchronization Extensions for High-Performance Computing
    Yoo, Richard M.
    Hughes, Christopher J.
    Lai, Konrad
    Rajwar, Ravi
    [J]. 2013 INTERNATIONAL CONFERENCE FOR HIGH PERFORMANCE COMPUTING, NETWORKING, STORAGE AND ANALYSIS (SC), 2013,
  • [77] Yoo RM, 2008, SPAA'08: PROCEEDINGS OF THE TWENTIETH ANNUAL SYMPOSIUM ON PARALLELISM IN ALGORITHMS AND ARCHITECTURES, P265
  • [78] Yu Yuan, 2005, Racetrack: efficient detection of data race conditions via adaptive tracking, P221