Go's sync.Mutex: Spin, Starve, and the Four-Millisecond Handoff
sync.Mutex is an int32 state word and a semaphore: CAS fast path, four spin rounds, FIFO wait queue, and a starvation mode that hands ownership straight to the longest waiter.
sync.Mutex is an int32 state word and a semaphore: CAS fast path, four spin rounds, FIFO wait queue, and a starvation mode that hands ownership straight to the longest waiter.