2 ms·
Fairness is expensive. A lock must go to the thread that is eligible to get that lock according to fairness, even if another ineligible thread is executing on a
by kazinator 8y ago
Fairness is expensive. A lock must go to the thread that is eligible to get that lock according to fairness, even if another ineligible thread is executing on a CPU and is ready to grab that lock. The ineligible thread is forced to block, and the ineligible one may have to be woken up and assigned to a CPU. Until the eligible thread is dispatched and grabs the lock, multiple cores may wastefully go through a thread switch due to hitting that lock instead of just grabbing and releasing it.