[KongchangAI]
ConceptCAS / 比较并交换 / CMPXCHG

Compare-and-Swap

An atomic CPU instruction that compares the value at a memory location with an expected value and performs a write only if they match. It serves as a fundamental primitive for building lock-free concurrent data structures.

Timeline (last 90 days)

Oct 1

Compare-and-Swap (CAS) atomically switches a pointer from an old state to a new state, on the condition that the old state has not changed since the last read; otherwise the operation fails, and ultimately only one thread can successfully install the new state.

Unverified50%

All Facts (1)

Source Articles