Improved Hardware Primitives
Seek a basic primitive suitable for range of cases
Load-Locked (or Load-Linked), Store-Conditional
LL reads location into a register
Follow with arbitrary instructions to manipulate value
SC tries to store back to location if and only if no other processor has written to the variable since this processor’s LL
- If SC succeeds, all three steps happened “atomically”
- If fail, don’t write or generate invalidations (must retry LL)
- Success indicated by condition codes