Descriptionsync/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
Patch Set 1 #Patch Set 2 : diff -r c79b24056eb1c5836ce808748982cdcee9709597 https://dvyukov%40google.com@code.google.com/p/go/ #Patch Set 3 : diff -r c79b24056eb1c5836ce808748982cdcee9709597 https://dvyukov%40google.com@code.google.com/p/go/ #Patch Set 4 : diff -r c79b24056eb1c5836ce808748982cdcee9709597 https://dvyukov%40google.com@code.google.com/p/go/ #
MessagesTotal messages: 3
|