1
0
mirror of https://github.com/golang/go synced 2024-09-24 05:10:13 -06:00

doc: mention concurrent map write/iterate detector

Mention that the best-effort race detector on maps
was upgraded to detect write/iterate races.

Fixes #18137

Change-Id: Ib6e0adde47e965126771ea712386031a2a55eba3
Reviewed-on: https://go-review.googlesource.com/33768
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Keith Randall 2016-12-01 08:37:48 -08:00 committed by Brad Fitzpatrick
parent 6c7978fc89
commit ac9962fb23

View File

@ -442,6 +442,26 @@ version of gccgo.
documentation</a> and its example for more details. documentation</a> and its example for more details.
</p> </p>
<h3 id="mapiter">Concurrent Map Misuse</h3>
<p>
In Go 1.6, the runtime
<a href="/doc/go1.6#runtime">added lightweight,
best-effort detection of concurrent misuse of maps</a>. This release
improves that detector with support for detecting programs that
concurrently write to and iterate over a map.
</p>
<p>
As always, if one goroutine is writing to a map, no other goroutine should be
reading (which includes iterating) or writing the map concurrently.
If the runtime detects this condition, it prints a diagnosis and crashes the program.
The best way to find out more about the problem is to run the program
under the
<a href="https://blog.golang.org/race-detector">race detector</a>,
which will more reliably identify the race
and give more detail.
</p>
<h3 id="memstats">MemStats Documentation</h3> <h3 id="memstats">MemStats Documentation</h3>
<p> <!-- CL 28972 --> <p> <!-- CL 28972 -->