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.
翻译:本文提出Hapax锁——一种新颖的锁算法,其设计简洁,具有恒定时间的到达与解锁路径,支持先进先出准入顺序,同时在常见竞争场景下具备空间高效性且产生相对较少的一致性流量。Hapax锁在性能(包括延迟与可扩展性)方面与最先进的锁机制相当,同时对运行时环境的约束和依赖更少,使其特别易于集成或改造到现有系统及现有应用程序接口中。尤其值得注意的是,该算法中不存在指针在线程间转移或逃逸所有权的情况。