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锁在性能(包括延迟与可扩展性)方面可与最先进的锁机制相媲美,同时对运行时环境施加更少的约束与依赖,使其能够轻松集成或改造到现有系统及应用程序接口中。特别值得注意的是,该算法中不存在指针在线程间转移或逃逸所有权的情况。