News for hackers. Stuff that matters.
Re:Hell is a multi-threaded C++ program (2006) by kbwt on Saturday September 02, 2017 @03:39PM (#15157808)
> 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.

There are no comments on this comment yet.