# On Fair & Scalable Locks

DevFeed: [On Fair & Scalable Locks](<https://devfeed.tech/articles/on-fair-scalable-locks-24840.md>)

Original publisher: [Read original article](<https://alidg.me/blog/2020/3/7/scalable-fair-lock>)

Author: Alimate

Published: 2020-03-07T00:00:00Z

Content type: tutorial

Language: en

Sources: [Ali Dehghan - Kemikit](<https://devfeed.tech/sources/ali-dehghan-kemikit.md>)

Topics: [Concurrency](<https://devfeed.tech/topics/concurrency.md>), [Optimization](<https://devfeed.tech/topics/optimization.md>), [Benchmark](<https://devfeed.tech/topics/benchmark.md>), [cpu](<https://devfeed.tech/topics/cpu.md>)

Tags: [atomic](<https://devfeed.tech/tags/atomic.md>), [benchmark](<https://devfeed.tech/tags/benchmark.md>), [cpu](<https://devfeed.tech/tags/cpu.md>), [latency](<https://devfeed.tech/tags/latency.md>), [locks](<https://devfeed.tech/tags/locks.md>), [optimization](<https://devfeed.tech/tags/optimization.md>), [threads](<https://devfeed.tech/tags/threads.md>)

## AI overview

This tutorial explains test-and-set (TAS) locks and test-test-and-set (TTAS) locks, then compares them with a multithreaded benchmark. The supplied text reports that TTAS has better throughput and lower-jitter latency than TAS in that benchmark.

## Source excerpt

Let's implement a fair and highly scalable lock!