🤖 AI Summary
Existing lock mechanisms suffer from limitations in latency, scalability, memory overhead, cache-coherence traffic under contention, and runtime dependencies. This paper introduces Hapax Locks: a lightweight, value-based mutual exclusion primitive that eliminates traditional pointer sharing and ownership transfer. Hapax achieves constant-time lock acquisition and release while strictly enforcing FIFO queuing order. Its design is structurally minimal and space-efficient—requiring only constant memory—and significantly reduces cache-synchronization overhead during contention. Crucially, it imposes no requirements on specialized runtime support, ensuring compatibility with mainstream operating systems and standard API frameworks, and enabling seamless integration. Experimental evaluation demonstrates that Hapax matches the performance of state-of-the-art lock algorithms while substantially reducing system coupling, thereby enhancing deployment flexibility and broadening applicability across diverse software environments.
📝 Abstract
We present Hapax Locks, a novel locking algorithm that is simple, enjoys constant-time arrival and unlock paths, provides FIFO admission order, and which is also space efficient and generates relatively little coherence traffic under contention in the common case. Hapax Locks offer performance (both latency and scalability) that is comparable with the best state of the art locks, while at the same time Hapax Locks impose fewer constraints and dependencies on the ambient runtime environment, making them particularly easy to integrate or retrofit into existing systems or under existing application programming interfaces Of particular note, no pointers shift or escape ownership between threads in our algorithm.