开发者

Why does Compare-And-Swap use Memory and Register

Why does the atomic swap instruction, which can be used to implement spin locks exchange data between a register and a memory location rather th开发者_运维问答an swapping two registers’ contents?


The point is to change the memory atomically, you gain nothing by just swapping registers around because they only hold temporary data anyway.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜