Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
为什么原子交换指令(可用于实现自旋锁)在寄存器和内存位置之间交换数据,而不是交换两个寄存器的内容?
关键是原子地改变内存,仅仅交换寄存器就没有任何好处,因为它们只保存临时数据。