Overview
LL/SC is an alternative to Compare-and-Swap (CAS) used primarily in RISC architectures (like ARM, MIPS, and PowerPC).
How it Works
- Load-Link (LL): Reads a value from memory and 'monitors' that address.
- Store-Conditional (SC): Tries to write a new value to the same address. The write only succeeds if no other processor has modified that address since the LL instruction.
Advantage
Avoids the 'ABA problem' inherent in simple CAS operations without requiring extra tags or version numbers.