Skip to content

Commit 8c7111d

Browse files
committed
fixup atomics
1 parent 36a8b94 commit 8c7111d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/doc/tarpl/atomics.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,12 @@ x = 1; y *= 2;
8585

8686
Ideally this program has 2 possible final states:
8787

88-
* `y = 3`: (thread 2 did the check before thread 1 completed) y = 6`: (thread 2
89-
* `did the check after thread 1 completed)
88+
* `y = 3`: (thread 2 did the check before thread 1 completed)
89+
* `y = 6`: (thread 2 did the check after thread 1 completed)
9090

9191
However there's a third potential state that the hardware enables:
9292

93-
* `y = 2`: (thread 2 saw `x = 2`, but not `y = 3`, and then overwrote `y = 3`)
93+
* `y = 2`: (thread 2 saw `x = 1`, but not `y = 3`, and then overwrote `y = 3`)
9494

9595
It's worth noting that different kinds of CPU provide different guarantees. It
9696
is common to separate hardware into two categories: strongly-ordered and weakly-

0 commit comments

Comments
 (0)