aboutsummaryrefslogtreecommitdiff
path: root/src/encoding
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2015-12-07 14:22:08 -0500
committerRuss Cox <rsc@golang.org>2015-12-07 20:19:52 +0000
commit50c5042047be3af36e7bb478435093ea45e8f1f0 (patch)
treedd7ca2ce452f7f9d0076d7afa21efaf4b88316cb /src/encoding
parent7ebb96a4890de3245f00cfb969945ff2438cc267 (diff)
downloadgo-50c5042047be3af36e7bb478435093ea45e8f1f0.tar.xz
runtime: best-effort detection of concurrent misuse of maps
If reports like #13062 are really concurrent misuse of maps, we can detect that, at least some of the time, with a cheap check. There is an extra pair of memory writes for writing to a map, but to the same cache line as h.count, which is often being modified anyway, and there is an extra memory read for reading from a map, but to the same cache line as h.count, which is always being read anyway. So the check should be basically invisible and may help reduce the number of "mysterious runtime crash due to map misuse" reports. Change-Id: I0e71b0d92eaa3b7bef48bf41b0f5ab790092487e Reviewed-on: https://go-review.googlesource.com/17501 Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Austin Clements <austin@google.com>
Diffstat (limited to 'src/encoding')
0 files changed, 0 insertions, 0 deletions