Implementation of various spin locks to ensure mutual exlusion among threads.
Benchmarked performance on Intel® Xeon(R) Gold 5220R CPU @ 2.20GHz × 48 (24 Cores with Intel Hyper-Threading)
- Filter Lock (Generalized Peterson)
- Lamport's Bakery Algorithm
- Peterson's Tournament (Binary Tree Structure)
- TAS Lock
- TTAS Lock
- CLH Lock
- MCS Lock
- HemLock (Oracle)
Measured scalability performance of locks using a simple Counter. Each data point is averaged over 10 runs.
- Java: openjdk version "11.0.22"
- Apache Ant for building the project
- Python scripts to automate data collection and performance analysis
Lamport's bakery: https://dl.acm.org/doi/10.1145/361082.361093
Hemlock: https://arxiv.org/abs/2102.03863
Art of Multiprocessor Programming by Maurice Herlihy & Nir Shavit