What is Load-reserved/store-conditional (LR/SC)?

A pair of instructions, also called LL/SC: if another core writes the address after the load-reserved, the store-conditional fails, enabling atomic updates.

Field: Multicore & Synchronization

Load-reserved/store-conditional (LR/SC) in the explanations

Questions that mention Load-reserved/store-conditional (LR/SC) (3)

  1. With an instruction pair such as RISC-V LR/SC (load-reserved / store-conditional), when does the SC fail?
  2. Which describes an atomic instruction?
  3. Which describes the ABA problem that affects lock-free data structures built with CAS?

Related terms

Atomic instruction Compare-and-swap ABA problem Acquire-release semantics Barrier synchronization Bus snooping Condition variable Critical section Data race Deadlock

Back to the glossary