To acquire the lease the thread is required to execute an expensive atomic instruction.
为了获得这份契约,线程必须执行一个代价昂贵的原子指令。
Note that the CMPXCHG instruction is atomic, which means that there is no intermediate visible state of the system before this instruction finishes.
注意,CMPXCHG指令是原子性的,这意味着在这个指令结束之前没有可见的中间状态。
This could happen, for instance, if atomic CPU instruction is used to implement a mutex (as in "lock-free" algorithms).
这可能发生,例如,如果原子cpu指令是用来实现互斥(如无锁定算法)。
应用推荐