3 ms·
> mutexes are slow Be careful with that. First off, what people refer to as "mutex" is usually a spinlock that falls back to a kernel wait queue when the spin
by kbwt 9y ago
> mutexes are slow
Be careful with that. First off, what people refer to as "mutex" is usually a spinlock that falls back to a kernel wait queue when the spin count is exceeded. There are even adaptive mutexes that figure out at runtime how long the lock is typically held and base their spin count limit on that.
Secondly, busy-waiting is often worse than a single slow program, because you actively slow down all of the other running programs.