Home Benchmarks Software Miscellaneous

Spinlocks

These implementations are old and have gone through major over-hauls. I've also done new studies. Expect an update soon (estimated date around the end of October). Different spinlock algorithms implement different synchronization protocols consisting of a lock phase and unlock phase (or acquisition and release phase). Different waiting mechanisms are used to block the process (or processor) attempting to acquire the spinlock until the lock is once again available for acquisition. A latency mismatch can occur in the lock phase, the unlock phase or both phases from process to process due to several architectural constraints. If there is a mismatch in lock/unlock phase latency between different processes then unfairness becomes much more evident. Spinlock implementations which generate a lot of cache traffic exasperate unfairness. This can lead to resource starvation when a process cannot acquire resources quickly enough in order to complete its task at a reasonable rate.

Current Implementations

ProgramAlgorithmFairness
casCompare and swapNone
cas_gbcas with geometric back-offNone
cas_rdcas with non-serializing busy loopNone
incIncrement/DecrementNone
inc_gbIncrement/Decrement with geometric backoffNone
mcsMellor-Crummey and Scott queue lockFIFO
ticketTicket lockFIFO

Notes

Benchmark Description

Measurements are captured from ~10 seconds of micro-benchmark execution. As benchmarks were run in user-space, context switching overhead must be taken into account. A snapshot of the development version of the benchmark suite is available for download. The benchmark suite and spinlock implementations are a work in progress. Please note that throughput is scaled to 1/60.

Performance Measurements

Acknowledgements

Arctic Region Supercomputing Center, Yih-Feng Hwang, Fahad Al-Dhelaan, Travis Geiselbrecht, Nick Piggin, Michael Scott.
© 2007 - 2011 Samy Al Bahra.