Medium
Spinlock vs std::mutex when the lock holder is preempted
Four threads run on a 4-core machine. Thread T1 acquires a lock and, while holding it, is preempted by the OS scheduler before releasing it (e.g., its time slice ends on a timer interrupt). The other three threads are all waiting to acquire the same lock. Which lock implementation is most likely to make this scenario dramatically worse?
5 of 51 in Concurrency