]> Cypherpunks.ru repositories - gostls13.git/blobdiff - doc/go_mem.html
cmd/compile/internal/inline: score call sites exposed by inlines
[gostls13.git] / doc / go_mem.html
index 661e1e781cff60ac90138ad0bf5671ffa7a120f2..026c1172e3a4c0ea9fa8f147202471f083b2cae8 100644 (file)
@@ -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>