3 ms·
Futex are a linux kernel-level specific waiting primitive [1]. The point of the OP is that mutex implemented on top of a futex has a purely userspace fast path
by gpderetta 9y ago
Futex are a linux kernel-level specific waiting primitive [1]. The point of the OP is that mutex implemented on top of a futex has a purely userspace fast path that needs only a single CAS for each acquire and release in the uncontended space, so in this scenario an userspace spin-lock is not often significantly better (a spin lock release only need a store on some machines though). Spin locks are significantly worse in the contended space though.
[1] futexes enable Fast Userspace muTEXES, but futex themselves are kernel space and not particularly fast.
- chriscappuccio 9y agoOpenBSD implements futex now, too. Major league userland responsiveness improvements for futex based mutexes.