3 ms·
Yes, but it's not so uncommon for "spinlocks" to evolve into not-actually-spinlocks while keeping the name. In the Linux kernel, `spinlock_t` is actually a mut
by comex 5y ago
Yes, but it's not so uncommon for "spinlocks" to evolve into not-actually-spinlocks while keeping the name. In the Linux kernel, `spinlock_t` is actually a mutex if `PREEMPT_RT` is enabled [1]. And Darwin has some code to do this in userspace [2], although I'm not sure if it's actually used.
[1] https://www.kernel.org/doc/html/latest/locking/locktypes.html https://www.kernel.org/doc/html/latest/locking/locktypes.htm...
[2] https://github.com/apple/darwin-libplatform/blob/main/src/os/lock.c#L221 https://github.com/apple/darwin-libplatform/blob/main/src/os...