aboutsummaryrefslogtreecommitdiff
path: root/doc/go_faq.html
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2018-01-19 09:34:24 -0800
committerIan Lance Taylor <iant@golang.org>2018-01-20 01:58:21 +0000
commit984e81f64e0c8ec67497fde5ea0dcbefcd1e51b1 (patch)
tree941ab21be00bf968bb8df055d145ccc130c85152 /doc/go_faq.html
parent68ce117cf17b8debf5754bfd476345779b5b6616 (diff)
downloadgo-984e81f64e0c8ec67497fde5ea0dcbefcd1e51b1.tar.xz
doc/faq: clarify that concurrent maps reads are safe
Fixes #23480 Change-Id: I33b4bdc60b9983ab62d87bfa0ae3ff33304269c0 Reviewed-on: https://go-review.googlesource.com/88515 Reviewed-by: Rob Pike <r@golang.org>
Diffstat (limited to 'doc/go_faq.html')
-rw-r--r--doc/go_faq.html9
1 files changed, 9 insertions, 0 deletions
diff --git a/doc/go_faq.html b/doc/go_faq.html
index c038bc46bd..f273688705 100644
--- a/doc/go_faq.html
+++ b/doc/go_faq.html
@@ -479,6 +479,15 @@ as when hosting an untrusted program, the implementation could interlock
map access.
</p>
+<p>
+Map access is unsafe only when updates are occurring.
+As long as all goroutines are only reading—looking up elements in the map,
+including iterating through it using a
+<code>for</code> <code>range</code> loop—and not changing the map
+by assigning to elements or doing deletions,
+it is safe for them to access the map concurrently without synchronization.
+</p>
+
<h3 id="language_changes">
Will you accept my language change?</h3>