Skip to content

Commit

Permalink
Merge #273
Browse files Browse the repository at this point in the history
273: Clarify CAS availability r=adamgreig a=jamesmunns



Co-authored-by: James Munns <james.munns@ferrous-systems.com>
  • Loading branch information
bors[bot] and James Munns authored Nov 17, 2020
2 parents ca8169e + aa6afe7 commit ba34b8a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/concurrency/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,11 @@ are using multiple cores.

## Atomic Access

On some platforms, atomic instructions are available, which provide guarantees
about read-modify-write operations. Specifically for Cortex-M, `thumbv6`
(Cortex-M0) does not provide atomic instructions, while `thumbv7` (Cortex-M3
and above) do. These instructions give an alternative to the heavy-handed
On some platforms, special atomic instructions are available, which provide
guarantees about read-modify-write operations. Specifically for Cortex-M: `thumbv6`
(Cortex-M0, Cortex-M0+) only provide atomic load and store instructions,
while `thumbv7` (Cortex-M3 and above) provide full Compare and Swap (CAS)
instructions. These CAS instructions give an alternative to the heavy-handed
disabling of all interrupts: we can attempt the increment, it will succeed most
of the time, but if it was interrupted it will automatically retry the entire
increment operation. These atomic operations are safe even across multiple
Expand Down

0 comments on commit ba34b8a

Please sign in to comment.