OctopusLian / leetcode-solutions

LeetCode,LintCode,牛客网,企业题库,《Sword to Offer》,《Cracking the Coding Interview》题解
MIT License
4 stars 4 forks source link

每日一题:CAS知道么?底层实现? 会引发什么问题?如何解决ABA问题?(海康) #180

Closed OctopusLian closed 2 years ago

OctopusLian commented 4 years ago

https://www.yuque.com/fudadajiagoushimeiriyiti/rqui93/zt2yg4 简单回答:cmpxchg原子指令。aba,循环开销大,一个共享变量。