All Projects → ssbl → concurrent-deque

ssbl / concurrent-deque

Licence: MIT license
Lock-free concurrent work stealing deque in C++

Programming Languages

C++
36643 projects - #6 most used programming language
CMake
9771 projects

Projects that are alternatives of or similar to concurrent-deque

hatrack
Fast, multi-reader, multi-writer, lockless data structures for parallel programming
Stars: ✭ 55 (+120%)
Mutual labels:  concurrent-data-structure
concurrent-resource
A header-only C++ library that allows easily creating thread-safe, concurrency friendly resources.
Stars: ✭ 17 (-32%)
Mutual labels:  concurrent-data-structure
lock-free-queue
CN-CppUserGroup-2019-1,lock-free queue demo
Stars: ✭ 58 (+132%)
Mutual labels:  lock-free-queue
java-multithread
Códigos feitos para o curso de Multithreading com Java, no canal RinaldoDev do YouTube.
Stars: ✭ 24 (-4%)
Mutual labels:  concurrent-data-structure
lfqueue
lock-free FIFO queue by C native built it, easy built cross platform(no extra dependencies needed) , guarantee thread safety memory management ever!
Stars: ✭ 104 (+316%)
Mutual labels:  lock-free-queue
42nd-at-threadmill
A SIMD-accelerated concurrent hash table.
Stars: ✭ 49 (+96%)
Mutual labels:  concurrent-data-structure
go-left-right
A faster RWLock primitive in Go, 2-3 times faster than RWMutex. A Go implementation of concurrency control algorithm in paper <Left-Right - A Concurrency Control Technique with Wait-Free Population Oblivious Reads>
Stars: ✭ 42 (+68%)
Mutual labels:  concurrent-data-structure
Zio
ZIO — A type-safe, composable library for async and concurrent programming in Scala
Stars: ✭ 3,167 (+12568%)
Mutual labels:  concurrent-data-structure
Taskflow
A General-purpose Parallel and Heterogeneous Task Programming System
Stars: ✭ 6,128 (+24412%)
Mutual labels:  work-stealing
lfqueue
Minimize lock-free queue ever!
Stars: ✭ 107 (+328%)
Mutual labels:  lock-free-queue

A lock-free work-stealing deque

This is a C++ implementation of the Chase-Lev deque, a concurrent single-producer, multi-consumer queue presented in the paper "Dynamic Circular Work-Stealing Deque". Additionally, this deque handles reclamation of unused storage at the cost of some coordination between the stealers and the worker.

This implementation is heavily based on the improved version presented in the paper "Correct and Efficient Work-Stealing for Weak Memory Models". The Rust crossbeam crate also provided a ton of inspiration.

Usage

With deque.hpp in your include path:

#include "deque.hpp"

auto ws = deque::deque<int>();
auto worker = std::move(ws.first);
auto stealer = std::move(ws.second);

// The worker can push and pop from one end of the queue.
worker.push(1);
worker.pop();

// Stealers can pop from the other end of the queue.
worker.push(1);
std::thread stealer_thread([&stealer]() {
  // Each stealer thread creates a copy.
  auto stealer_copy = stealer;
  stealer_copy.steal();
});

stealer.steal();
stealer_thread.join();
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].