使用4 个CPU 时的同步、协商锁和公平锁的相对吞吐率
Figure 3. Relative throughput for synchronization, barging Lock, and fair Lock, with four CPUs
要确保公平所需要的记帐(bookkeeping)和同步,就意味着被争夺的公平锁要比不公平锁的吞吐率更低。
The bookkeeping and synchronization required to ensure fairness mean that contended fair locks will have much lower throughput than unfair locks.
为什么我们不让所有的锁都公平呢?
为什么我们不让所有的锁都公平呢?
应用推荐