码迷,mamicode.com
首页 > 其他好文 > 详细

cas

时间:2014-05-26 16:06:53      阅读:217      评论:0      收藏:0      [点我收藏+]

标签:c   a   width   问题   for   new   

CAS,当oldVal与expected相同时,将oldVal更新为newVal,原子操作

ABA problem:

when a location is read twice, has the same value for both reads, and "value is same“ is used to indicate "nothing has changed". however, another thread can execute between the two reads and change the value, do other work, then change the value back.

为了解决ABA问题,DCAS,Double-width CAS等都被相应提出

Exceptional backoff

 

 

reader-writer problem:

cas,布布扣,bubuko.com

cas

标签:c   a   width   问题   for   new   

原文地址:http://www.cnblogs.com/starfuxks/p/3746197.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!