tag | 27c5d0397bace07f5a8cd925202a985452498e9e | |
---|---|---|
tagger | Prashant Varanasi <prashant@uber.com> | Tue Nov 14 13:05:58 2017 -0800 |
object | 8474b86a5a6f79c443ce4b2992817ff32cf208b8 |
v1.3.1
commit | 8474b86a5a6f79c443ce4b2992817ff32cf208b8 | [log] [tgz] |
---|---|---|
author | Prashant Varanasi <github@prashantv.com> | Tue Nov 14 12:44:01 2017 -0800 |
committer | GitHub <noreply@github.com> | Tue Nov 14 12:44:01 2017 -0800 |
tree | 5eefc23fd2b014d54a2b69550e10e5cce3479816 | |
parent | 54e9e20165431ae155d56ca42d406b7a69fa7192 [diff] |
Add standard library atomic operations to benchmark (#35) Currently, we only benchmark our custom atomic types, but don't benchmark the standard library types. Add benchmarks for ints and uints that the standard library supports.
Simple wrappers for primitive types to enforce atomic access.
go get -u go.uber.org/atomic
The standard library‘s sync/atomic
is powerful, but it’s easy to forget which variables must be accessed atomically. go.uber.org/atomic
preserves all the functionality of the standard library, but wraps the primitive types to provide a safer, more convenient API.
var atom atomic.Uint32
atom.Store(42)
atom.Sub(2)
atom.CAS(40, 11)
See the documentation for a complete API specification.
Stable.