Linuxのpthread_mutexの実装で使われているfutexも競合しないタイミングならユーザランドだけで処理が完結する (OSが仲裁する必要があるのは競合する場合だけ)
> Futex operation occurs entirely in user space for the
> noncontended case. The kernel is involved only to arbitrate the
> contended case. As any sane design will strive for
> noncontention, futexes are also optimized for this situation.
>
> https://man7.org/linux/man-pages/man7/futex.7.html
キューが固定長, 投入スレッド1つ, 取り出しスレッド1つという条件でならアトミック変数2つ(読み出し位置, 書き込み位置)で「競合しない」ように出来るので, OSの仲裁が必要じゃなくなる