sync/atomic: add Value
A Value provides an atomic load and store of a consistently typed value. It's intended to be used with copy-on-write idiom (see the example). Performance: BenchmarkValueRead 50000000 21.7 ns/op BenchmarkValueRead-2 200000000 8.63 ns/op BenchmarkValueRead-4 300000000 4.33 ns/op TBR=rsc R=golang-codereviews CC=golang-codereviews https://golang.org/cl/136710045
Showing
src/sync/atomic/norace.go
0 → 100644
src/sync/atomic/race.go
0 → 100644
src/sync/atomic/value.go
0 → 100644
Please
register
or
sign in
to comment