Commit Graph

14 Commits

Author SHA1 Message Date
alexeypavlenko
bb9a8edc0f Introduce an atomic type-safe wrapper around error type. (#42) 2018-09-27 09:07:59 -07:00
Nathan Jordan
1ea20fb1cb add atomic duration type (#37)
wrapper around existing `Int64` type for atomic operations on `time.Duration` values
2018-05-01 10:38:09 -07:00
Prashant Varanasi
8474b86a5a 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.
2017-11-14 12:44:01 -08:00
Prashant Varanasi
54e9e20165 Add parallel benchmarks (#34)
Atomic operations tend to be fast when there's no contention but get a
lot slower with contention, so add tests which run the same stress test
in parallel.
2017-11-14 11:42:34 -08:00
Prashant Varanasi
0ee2c2d995 Concurrently modify same atomic in stress tests (#33)
Currently, the stress tests start multiple goroutines, but they all have
their own local atomic, so they are not concurrently modifying the same
values. Return a function which can be run concurrently to modify the
same atomic.
2017-11-14 10:36:59 -08:00
Bill Fumerola
70bd1261d3 Use stress tests for benchmarks 2017-07-19 18:46:50 -04:00
Prashant Varanasi
3f020e6d5d Add Bool.CAS for compare-and-swap semantics (#23) 2017-05-09 12:57:10 -07:00
Anton Tyurin
3b8db5e93c Implement Add/Sub for Float64 (#17)
Signed-off-by: Anton Tiurin <noxiouz@yandex.ru>
2016-12-15 11:56:52 -08:00
Bill Fumerola
74ca5ec650 Add stress test for Float64 2016-12-14 13:12:48 -08:00
Prashant Varanasi
9058d5b913 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.
2016-12-13 11:10:34 -08:00
Prashant Varanasi
fecc23564a Add String as a type-safe wrapper for atomic.Value 2016-07-17 12:43:23 -07:00
Akshay Shah
7afff28c37 Add an atomic Boolean type (#4)
* Add an atomic Boolean type

Fixes #2.

* Feedback from CR

- Rename Swap to Toggle
- Add a more Swap-like Swap

* Add boolToInt helper
2016-05-30 11:10:24 -07:00
Akshay Shah
2051a605b9 Add a Sub method to atomics (#5)
* Add a Sub method to atomics

Fixes #3.

* Invert integer sign without multiplying
2016-05-28 22:54:33 -07:00
Prashant Varanasi
928a9d776b Import atomic package
The code is the same as github.com/uber/tchannel-go/atomic
2016-05-25 11:04:20 -07:00