High-performance N-thread software solutions for mutual exclusion

Peter A. Buhr, Dave Dice, Wim H. Hesselink

Research output: Contribution to journalArticleAcademicpeer-review

14 Citations (Scopus)
217 Downloads (Pure)

Abstract

Software solutions for mutual exclusion developed over a 30‐year period, starting with complex ad hoc algorithms and progressing to simpler formal ones. While it is easy to dismiss software solutions for mutual exclusion, as this family of algorithms is antiquated and most platforms support atomic hardware instructions, there is still a need for these algorithms in threaded, embedded systems running on low‐cost processors lacking atomic instructions. While N‐thread solutions are usually short (10–25 lines of code), each is ingenious with exceptionally subtle aspects, often making it difficult to prove correctness or construct an implementation. This work examines correctness and performance of the implementations. An extensive survey of existing algorithms is presented, with explanations of the intuition behind the algorithms and how they work. Several errors were found and corrections made, as well as a few small improvements, in the existing algorithms; two new high‐performance algorithms were developed. Finally, a worst‐case high‐contention performance experiment is performed to compare the algorithms and contrast them with three common locks based on hardware atomic instructions. The results show our two new algorithms are highly competitive with an equivalent hardware lock (Mellor‐Crummey and Scott) over a range of 1–32 processors. Hence, threading is a viable alternative to event‐driven programming for complex embedded systems without atomic instructions. Copyright © 2014 John Wiley & Sons, Ltd.
Original languageEnglish
Pages (from-to)651-701
Number of pages51
JournalConcurrency and Computation
Volume27
DOIs
Publication statusPublished - 10-Mar-2015

Fingerprint

Dive into the research topics of 'High-performance N-thread software solutions for mutual exclusion'. Together they form a unique fingerprint.

Cite this