Queue-Based And Adaptive Lock Algorithms For Scalable Resource Allocation On Shared-Memory Multiprocessors
Keywords
H-out-of-k mutual exclusion; Lock-free programming; Queue-based lock; Resource allocation
Abstract
We present a scalable lock algorithm and an adaptive scheme for shared-memory multiprocessors addressing the resource allocation problem, which is also known as the h-out-of-k mutual exclusion problem. In this problem, threads compete for k shared resources where a thread may request an arbitrary number 1≤h≤k of resources at the same time. The challenge is for each thread to acquire exclusive access to desired resources while preventing deadlock or starvation. Many existing approaches solve this problem in a distributed system, but the explicit message passing paradigm they adopt is not optimal for shared-memory. Other applicable methods, like two-phase locking and resource hierarchy, suffer from performance degradation under heavy contention, while lacking a desirable fairness guarantee. This work describes the first multi-resource lock algorithm that guarantees the strongest first-in, first-out fairness. Our methodology is based on a non-blocking queue where competing threads spin on previous conflicting resource requests. In our experimental evaluation we compared the overhead and scalability of our lock to the best available alternative approaches using a micro-benchmark. As contention increases, our multi-resource lock obtains an average of eight times speed-up over the alternatives including GNU C++’s lock method, Boost’s lock function, and Intel TBB’s queue mutex. To further improve the performance on low levels of contention, we introduce an adaptive scheme that is composed of two different lock algorithms and alternates the use the locks depending on the level of contention. Our experimental results show that the composite adaptive scheme achieves the best overall performance comparing with using either lock alone when system contention is not known a priori.
Publication Date
10-28-2015
Publication Title
International Journal of Parallel Programming
Volume
43
Issue
5
Number of Pages
721-751
Document Type
Article
Personal Identifier
scopus
DOI Link
https://doi.org/10.1007/s10766-014-0317-6
Copyright Status
Unknown
Socpus ID
84938966186 (Scopus)
Source API URL
https://api.elsevier.com/content/abstract/scopus_id/84938966186
STARS Citation
Zhang, Deli; Lynch, Brendan; and Dechev, Damian, "Queue-Based And Adaptive Lock Algorithms For Scalable Resource Allocation On Shared-Memory Multiprocessors" (2015). Scopus Export 2015-2019. 1126.
https://stars.library.ucf.edu/scopus2015/1126