News for hackers. Stuff that matters.
Re:Measuring mutexes, spinlocks and how bad the Linux schedu... by pizlonator on Tuesday December 31, 2019 @11:53PM (#21926721)
These are words that don’t necessarily mean different things. In the broadest sense of mutex and the strictest sense of spinlock, every spinlock is a mutex.

Spinlock is a mutex algorithm based on spinning until the mutex is available.

Mutex is a MUTual EXclusion abstraction. A spinlock is one implementation. But spinlocks are problematic (for lots of reasons) so most of the time when someone says they’ve got a mutex it’s actually an adaptive lock:

- It has a fast path to acquire the lock.

- It may or may not be fair.

- It has a slow path that may enqueue the thread and deschedule it, but that slow path may have some adaptive spinning for a finite amount of time.

There are no comments on this comment yet.