|
|
|
|
|
by kprotty
1033 days ago
|
|
A spinlock can be conditionally faster than a lock with uses futex, but it doesn't scale. Futex is really meant to provide an efficient way to block and unblock threads. One could use FUTEX_LOCK_PI to have it actually implement a lock, but that's a separate argument/edge-case. |
|
Some relevant reading: https://matklad.github.io/2020/01/04/mutexes-are-faster-than...