unagi-chan: Fast concurrent queues with a Chan-like API, and more
This library provides implementations of concurrent FIFO queues (for both general boxed and primitive unboxed values) that are fast, perform well under contention, and offer a Chan-like interface. The library may be of limited usefulness outside of x86 architectures where the fetch-and-add instruction is not available.
We export several variations of our design; some support additional
functionality while others try for lower latency by removing features or
making them more restrictive (e.g. in the Unboxed
variants).
Unagi
: a general-purpose near drop-in replacement forChan
.Unagi.Unboxed
: likeUnagi
but specialized for primitive types; this may perform better if a queue grows very large.Unagi.Bounded
: a bounded variant with blocking and non-blocking writes, and other functionality where a notion of the queue's capacity is required.Unagi.NoBlocking
: lowest latency implementations for when blocking reads aren't required.Unagi.NoBlocking.Unboxed
: likeUnagi.NoBlocking
but for primitive types.
Some of these may be deprecated in the future if they are found to provide little performance benefit, or no unique features; you should benchmark and experiment with them for your use cases, and please submit pull requests for additions to the benchmark suite that reflect what you find.
Here is an example benchmark measuring the time taken to concurrently write and read 100,000 messages, with work divided amongst increasing number of readers and writers, comparing against the top-performing queues in the standard libraries. The inset graph shows a zoomed-in view on the implementations here.
Modules
[Index] [Quick Jump]
Flags
Manual Flags
Name | Description | Default |
---|---|---|
compare-benchmarks | Disabled |
Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info
Downloads
- unagi-chan-0.4.1.4.tar.gz [browse] (Cabal source package)
- Package description (as included in the package)
Maintainer's Corner
For package maintainers and hackage trustees
Candidates
Versions [RSS] | 0.1.0.0, 0.1.0.1, 0.1.0.2, 0.1.1.0, 0.2.0.0, 0.2.0.1, 0.3.0.0, 0.3.0.1, 0.3.0.2, 0.4.0.0, 0.4.1.0, 0.4.1.1, 0.4.1.2, 0.4.1.3, 0.4.1.4 |
---|---|
Change log | CHANGELOG.markdown |
Dependencies | atomic-primops (>=0.8), base (>=4.7 && <5), ghc-prim, primitive (>=0.5.3) [details] |
Tested with | ghc ==7.8.4 || ==7.10.3 || ==8.0.2 || ==8.2.2 || ==8.4.4 || ==8.6.4 || ==8.8.1 || ==8.10.7 |
License | BSD-3-Clause |
Author | Brandon Simmons |
Maintainer | brandon.m.simmons@gmail.com |
Category | Concurrency |
Source repo | head: git clone https://github.com/jberryman/unagi-chan.git -b master |
Uploaded | by BrandonSimmons at 2021-12-02T16:00:44Z |
Distributions | Arch:0.4.1.4, LTSHaskell:0.4.1.4, NixOS:0.4.1.4, Stackage:0.4.1.4 |
Reverse Dependencies | 33 direct, 153 indirect [details] |
Downloads | 23332 total (220 in the last 30 days) |
Rating | 2.5 (votes: 5) [estimated by Bayesian average] |
Your Rating | |
Status | Docs available [build log] All reported builds failed as of 2021-12-06 [all 1 reports] |