Lock–Unlock
Authors:
Open Access
- 28 February 2018
- journal article
- research article
- Published by Association for Computing Machinery (ACM) in ACM Transactions on Computer Systems
- Vol. 36 (1) , 1-149
Abstract
A plethora of optimized mutex lock algorithms have been designed over the past 25 years to mitigate performance bottlenecks related to critical sections and locks. Unfortunately, there is currently no broad study of the behavior of these optimized lock algorithms on realistic applications that consider different performance metrics, such as energy efficiency and tail latency. In this article, we perform a thorough and practical analysis of synchronization, with the goal of providing software developers with enough information to design fast, scalable, and energy-efficient synchronization in their systems. First, we perform a performance study of 28 state-of-the-art mutex lock algorithms, on 40 applications, on four different multicore machines. We consider not only throughput (traditionally the main performance metric) but also energy efficiency and tail latency, which are becoming increasingly important. Second, we present an in-depth analysis in which we summarize our findings for all the studied applications. In particular, we describe nine different lock-related performance bottlenecks, and we propose six guidelines helping software developers with their choice of a lock algorithm according to the different lock properties and the application characteristics. From our detailed analysis, we make several observations regarding locking algorithms and application behaviors, several of which have not been previously discovered: (i) applications stress not only the lock–unlock interface but also the full locking API (e.g., trylocks, condition variables); (ii) the memory footprint of a lock can directly affect the application performance; (iii) for many applications, the interaction between locks and scheduling is an important application performance factor; (vi) lock tail latencies may or may not affect application tail latency; (v) no single lock is systematically the best; (vi) choosing the best lock is difficult; and (vii) energy efficiency and throughput go hand in hand in the context of lock algorithms. These findings highlight that locking involves more considerations than the simple lock/unlock interface and call for further research on designing low-memory footprint adaptive locks that fully and efficiently support the full lock interface, and consider all performance metrics.Keywords
Funding Information
- Agence Nationale de la Recherche (ANR-16-CE25-0013-01,ANR-11-LABX-0025-01)
- European Research Council (GRANT 339539 - AOC)
- AGIR (CAEC)
- BPI (16.010402.01)
- emsoc (replicanos)
- FSN (OCCIWare)
This publication has 58 references indexed in Scilit:
- Message Passing or Shared Memory: Evaluating the Delegation Abstraction for Multicores2013
- Real time power estimation and thread scheduling via performance countersACM SIGARCH Computer Architecture News, 2009
- A Hierarchical CLH Queue Lock2006
- Novozymes results for Jan-Sep 2002Focus on Catalysts, 2003
- Scheduler-conscious synchronizationACM Transactions on Computer Systems, 1997
- Selecting locking primitives for parallel programmingCommunications of the ACM, 1996
- Algorithms for scalable synchronization on shared-memory multiprocessorsACM Transactions on Computer Systems, 1991
- The performance of spin lock alternatives for shared-memory multiprocessorsIEEE Transactions on Parallel and Distributed Systems, 1990
- The convoy phenomenonACM SIGOPS Operating Systems Review, 1979
- Synchronization with eventcounts and sequencersCommunications of the ACM, 1979