aboutsummaryrefslogtreecommitdiff
path: root/doc/go_mem.html
diff options
context:
space:
mode:
Diffstat (limited to 'doc/go_mem.html')
-rw-r--r--doc/go_mem.html16
1 files changed, 14 insertions, 2 deletions
diff --git a/doc/go_mem.html b/doc/go_mem.html
index 661e1e781..026c1172e 100644
--- a/doc/go_mem.html
+++ b/doc/go_mem.html
@@ -159,6 +159,7 @@ union of the sequenced before and synchronized before relations.
For an ordinary (non-synchronizing) data read <i>r</i> on a memory location <i>x</i>,
<i>W</i>(<i>r</i>) must be a write <i>w</i> that is <i>visible</i> to <i>r</i>,
where visible means that both of the following hold:
+</p>
<ol>
<li><i>w</i> happens before <i>r</i>.
@@ -221,7 +222,7 @@ for programs that do contain races.
</p>
<p>
-First, any implementation can, upon detecting a data race,
+Any implementation can, upon detecting a data race,
report the race and halt execution of the program.
Implementations using ThreadSanitizer
(accessed with “<code>go</code> <code>build</code> <code>-race</code>”)
@@ -229,7 +230,18 @@ do exactly this.
</p>
<p>
-Otherwise, a read <i>r</i> of a memory location <i>x</i>
+A read of an array, struct, or complex number
+may by implemented as a read of each individual sub-value
+(array element, struct field, or real/imaginary component),
+in any order.
+Similarly, a write of an array, struct, or complex number
+may be implemented as a write of each individual sub-value,
+in any order.
+</p>
+
+<p>
+A read <i>r</i> of a memory location <i>x</i>
+holding a value
that is not larger than a machine word must observe
some write <i>w</i> such that <i>r</i> does not happen before <i>w</i>
and there is no write <i>w'</i> such that <i>w</i> happens before <i>w'</i>