File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -85,12 +85,12 @@ x = 1; y *= 2;
85
85
86
86
Ideally this program has 2 possible final states:
87
87
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)
90
90
91
91
However there's a third potential state that the hardware enables:
92
92
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 ` )
94
94
95
95
It's worth noting that different kinds of CPU provide different guarantees. It
96
96
is common to separate hardware into two categories: strongly-ordered and weakly-
You can’t perform that action at this time.
0 commit comments