A Preliminary Study of Minimal-Contention Locks

被引:0
作者
Machanick, Philip [1 ]
机构
[1] Rhodes Univ, Dept Comp Sci, Grahamstown, South Africa
来源
PROCEEDINGS OF THE ANNUAL CONFERENCE OF THE SOUTH AFRICAN INSTITUTE OF COMPUTER SCIENTISTS AND INFORMATION TECHNOLOGISTS (SAICSIT 2018) | 2018年
关键词
SYNCHRONIZATION;
D O I
10.1145/3278681.3278713
中图分类号
TP301 [理论、方法];
学科分类号
081202 ;
摘要
As multicore CPUs become more common, scalable synchronization primitives have wider use and ideas previously used in large-scale computation are worth re-opening for wider use. In this paper I explore one approach to scalable synchronization, a minimal-contention lock (M-lock). The key idea is to avoid spinning on a global variable but instead for each blocked task (process or thread) to spin on a local lock representing the task that immediately preceded it in attempting to acquire the lock. This creates an ordering based on the order in which tasks attempt to acquire the lock, preventing starvation. The only globally shared variable is a pointer to the next local lock to be contended for. Each contending task swaps the value of this pointer for a pointer to its own variable. It spins on the variable previously pointed to by the global pointer. Each waiting task spins on a lock only seen by itself and the owner of that lock variable. While a task is spinning, the lock variable can be held in its local cache until invalidated by the lock owner when it unsets the lock. Consequently, the amount of bus traffic is considerably less than with a spinlock, which has the pernicious feature that the task releasing the lock is delayed by all the other bus traffic arising from contention for the lock. An MCS lock has similar properties but is more complicated and requires more memory contention-causing operations. This paper outlines the design of the M-lock and provides a preliminary performance analysis.
引用
收藏
页码:269 / 278
页数:10
相关论文
共 27 条
  • [1] [Anonymous], UCBEECS201162
  • [2] [Anonymous], 2014, THESIS U MARYLAND
  • [3] Boyd-Wickizer S., 2012, P LIN S SAN DIEG CA, P119
  • [4] Boyd-Wickizer Silas., 2010, P 9 USENIX C OPERATI, P1
  • [5] Buttlar D.A., 1996, Pthreads Programming
  • [6] CHERITON DR, 1993, 7TH WORKSHOP ON PARALLEL AND DISTRIBUTED SIMULATION (PADS '93), P159
  • [7] The Scalable Commutativity Rule: Designing Scalable Software for Multicore Processors
    Clements, Austin T.
    Kaashoek, M. Frans
    Zeldovich, Nickolai
    Morris, Robert T.
    Kohler, Eddie
    [J]. ACM TRANSACTIONS ON COMPUTER SYSTEMS, 2015, 32 (04):
  • [8] Craig Travis, 1993, TECHNICAL REPORT
  • [9] Everything You Always Wanted to Know About Synchronization but Were Afraid to Ask
    David, Tudor
    Guerraoui, Rachid
    Trigonakis, Vasileios
    [J]. SOSP'13: PROCEEDINGS OF THE TWENTY-FOURTH ACM SYMPOSIUM ON OPERATING SYSTEMS PRINCIPLES, 2013, : 33 - 48
  • [10] A Survey of Hard Real-Time Scheduling for Multiprocessor Systems
    Davis, Robert I.
    Burns, Alan
    [J]. ACM COMPUTING SURVEYS, 2011, 43 (04)