All Projects → jberryman → Unagi Chan

jberryman / Unagi Chan

Licence: other
A haskell library implementing fast and scalable concurrent queues for x86, with a Chan-like API

Programming Languages

haskell
3896 projects

Projects that are alternatives of or similar to Unagi Chan

think-async
🌿 Exploring cooperative concurrency primitives in Python
Stars: ✭ 178 (+54.78%)
Mutual labels:  queue, concurrency
beems
a bee-queue based minimalist toolkit for building fast, decentralized, scalable and fault tolerant microservices
Stars: ✭ 33 (-71.3%)
Mutual labels:  queue, concurrency
Goconcurrentqueue
Go concurrent-safe, goroutine-safe, thread-safe queue
Stars: ✭ 127 (+10.43%)
Mutual labels:  concurrency, queue
Mpmcqueue
A bounded multi-producer multi-consumer concurrent queue written in C++11
Stars: ✭ 468 (+306.96%)
Mutual labels:  concurrency, queue
psched
Priority-based Task Scheduling for Modern C++
Stars: ✭ 59 (-48.7%)
Mutual labels:  queue, concurrency
easy-promise-queue
An easy JavaScript Promise queue which is automatically executed, concurrency controlled and suspendable.
Stars: ✭ 31 (-73.04%)
Mutual labels:  queue, concurrency
linked-blocking-multi-queue
A concurrent collection that extends the existing Java concurrent collection library, offering an optionally-bounded blocking "multi-queue" based on linked nodes.
Stars: ✭ 41 (-64.35%)
Mutual labels:  queue, concurrency
queueable
Convert streams to async ⌛ iterables ➰
Stars: ✭ 43 (-62.61%)
Mutual labels:  queue, concurrency
Spscqueue
A bounded single-producer single-consumer wait-free and lock-free queue written in C++11
Stars: ✭ 307 (+166.96%)
Mutual labels:  concurrency, queue
Arq
Fast job queuing and RPC in python with asyncio and redis.
Stars: ✭ 695 (+504.35%)
Mutual labels:  concurrency, queue
Hark Lang
Build stateful and portable serverless applications without thinking about infrastructure.
Stars: ✭ 103 (-10.43%)
Mutual labels:  concurrency
Php Fpm Queue
Use php-fpm as a simple built-in async queue
Stars: ✭ 103 (-10.43%)
Mutual labels:  queue
Tape
Chronicle Queue helpers
Stars: ✭ 112 (-2.61%)
Mutual labels:  queue
Onering
A collection of concurrent ring buffers
Stars: ✭ 114 (-0.87%)
Mutual labels:  queue
Yar
Light, concurrent RPC framework for PHP & C
Stars: ✭ 1,369 (+1090.43%)
Mutual labels:  concurrency
P Queue
Promise queue with concurrency control
Stars: ✭ 1,863 (+1520%)
Mutual labels:  queue
Foundatio
Pluggable foundation blocks for building distributed apps.
Stars: ✭ 1,365 (+1086.96%)
Mutual labels:  queue
Job
JOB, make your short-term command as a long-term job. 将命令行规划成任务的工具
Stars: ✭ 98 (-14.78%)
Mutual labels:  concurrency
Swimmer
🏊 Swimmer - An async task pooling and throttling utility for JS
Stars: ✭ 94 (-18.26%)
Mutual labels:  concurrency
Java Interview
At the beginning, it was the repository with questions from Java interviews. Currently, it's more like knowledge base with useful links.
Stars: ✭ 114 (-0.87%)
Mutual labels:  concurrency

Build Status

The library is available on hackage and you can install it with:

$ cabal install unagi-chan

Design

The idea is to design a queue around the x86 fetch-and-add instruction, which performs well under contention.

The queue is conceptually simple, consisting of: an infinite array, and two atomic counters, one for readers and another for writers. A read or write operation consists of incrementing the appropriate counter and racing to perform an atomic operation on the specified index.

If the writer wins it has written its value for the reader to find and exits. When it loses it does a rendezvous with the blocked or blocking reader, via another mechanism and hands off its value.

Linearizabillity

The queue has FIFO semantics, reasoning in terms of linearizability. Our atomic counter ensures that all non-overlapping reads and writes are assigned indices in temporal order.

Lockfree - ness

Operations are non-blocking, with the exception that a stalled writer may block at most one reader (the reader "assigned" to it by our internal counter).

Performance

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.

Benchmarks

Some of these variants 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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].