3 ms·
That's unnecessary pedantry, in context. I am explaining an important con of spinlocks. Whether it is because mutexes are fair or because they behave fair is co
by zamalek 4y ago
That's unnecessary pedantry, in context. I am explaining an important con of spinlocks. Whether it is because mutexes are fair or because they behave fair is completely irrelevant. The point is that if you use spinlocks (which the article incorrectly calls mutexes), then you could see unintuitive behavior under load.
- gpderetta 4y agoYou can have fair spinlocks if you handle queuing yourself. Also the article does indeed implement a real mutex (although a buggy one), not a spinlock. std::atomic::wait will use futexes (or whatever) underneath to genuinely put the process to sleep until it receives a wakeup.