commit | 9058d5b913b0411a06e55509fbf0dcb1e3dd62dc | [log] [tgz] |
---|---|---|
author | Prashant Varanasi <prashant@uber.com> | Tue Dec 13 11:09:27 2016 -0800 |
committer | Prashant Varanasi <prashant@uber.com> | Tue Dec 13 11:10:34 2016 -0800 |
tree | 05992882a44ba86d001340216ecc647635cbc1ec | |
parent | 9e99152552a6ce13fa3b2ce4a9c4fb117cca4506 [diff] |
Refactor stress tests and wait for the results Previously, we were not waiting for the spawned goroutines to end. Refactor the logic to use a common runStress that runs some function from multiple goroutines.
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.