Abstract

A lock is a mechanism to guarantee mutual exclusion with eventual progress, i.e., some degree of fairness. First-come-first-served (FCFS) progress is perfectly fair. FCFS progress can be offered by a locking algorithm or added by wrapping a non-FCFS lock with a separate FCFS algorithm. A new separate FCFS algorithm is presented that creates FCFS progress by wrapping a lock’s entry protocol (acquire). The algorithm addresses an important safety issue in locking, called barging, where arriving threads proceed before waiting threads or waiting threads are serviced with some bias. Barging increases latency for waiting threads and is non-intuitive to concurrent programmers, even though it is inherent to non-deterministic concurrent execution. A correctness proof is presented for the new FCFS algorithm and verified with the proof assistant PVS. Experimental tests are performed to ensure the presented wrapper provides FCFS progress when used to transform non-FCFS software and hardware locks. The performance of the non-FCFS and transformed FCFS counterparts is compared, and contrasted with locks using inherent FCFS progress. The results show the FCFS transforms are performant for most algorithms, providing an additional tool for application developers to achieve correctness without a significant global performance reduction.

Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call