Package0.1.2.4ConcurrencyDataData Structures
atomic-counter
Mutable counters that can be modified with atomic operatinos
- Version0.1.2.4
- CategoryConcurrency, Data, Data Structures
- LicenceApache-2.0
- AuthorSergey Vinokurov
- MaintainerSergey Vinokurov <serg.foo@gmail.com>
- Homepagegithub.com/sergv/atomic-counter
- Pinned byhackage atomic-counter 0.1.2.4
- Sourcehackage.haskell.org/package/atomic-counter-0.1.2.4
Modules
4 modules- Control.Concurrent.Counter11Work with lifted Counter values in the IO monad. Please see other
- Control.Concurrent.Counter.Lifted.IO11Lifted Control.Concurrent.Counter.Lifted.Counter specialized to
- Control.Concurrent.Counter.Lifted.ST11Counters that support some atomic operations. Safe to use from
- Control.Concurrent.Counter.Unlifted12Counters that support some atomic operations. Safe to use from
Description
This package defines Counter type that can be safely modified concurrently from multiple threads. The type supports only few operations, namely read, write, cas (compare and swap), add, subtract and a few bitwise ones like or, and xor.
Most common use case is having a shared counter that multiple threads increment. Another potential use case is lightweight locks.
Depends on
1 package- base-4.20.2.0with GHC