]> Cypherpunks repositories - gostls13.git/commit
runtime: do hashmap grow work during reads.
authorKeith Randall <khr@golang.org>
Sat, 1 Jun 2013 03:58:31 +0000 (20:58 -0700)
committerKeith Randall <khr@golang.org>
Sat, 1 Jun 2013 03:58:31 +0000 (20:58 -0700)
commit07b6add0ca1f1dc38270cddf3d30f9b06503c9e3
tree0c7819a5b975c4db885f0d7d58bea399e1c35af4
parent71f061043df89b1c1150b4ed2bf2d70a78b2af0d
runtime: do hashmap grow work during reads.

Before this change, grow work was done only
during map writes to ensure multithreaded safety.
This can lead to maps remaining in a partially
grown state for a long time, potentially forever.
This change allows grow work to happen during reads,
which will lead to grow work finishing sooner, making
the resulting map smaller and faster.

Grow work is not done in parallel.  Reads can
happen in parallel while grow work is happening.

R=golang-dev, dvyukov, khr, iant
CC=golang-dev
https://golang.org/cl/8852047
src/pkg/runtime/hashmap.c
src/pkg/runtime/hashmap_fast.c