Skip to content

Lock free, work stealing queue - #54

Draft
ptsouchlos wants to merge 1 commit into
mainfrom
feature/lock-free-deque
Draft

ptsouchlos wants to merge 1 commit into
mainfrom
feature/lock-free-deque

Conversation

@ptsouchlos

@ptsouchlos ptsouchlos commented Sep 29, 2023 •

Copy link
Copy Markdown
Owner

WIP 🚧

Adds a implementation of a Chase-Lev work stealing queue as described in the corresponding paper: "Correct and Efficient Work-Stealing for Weak Memory Models" and "Dynamic Circular Work-Stealing Deque" by Chase, Lev

@ptsouchlos ptsouchlos changed the title Feature/lock free deque Lock free, work stealing queue Sep 29, 2023
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
E Reliability Rating on New Code (required ≥ A)

See analysis details on SonarCloud

Catch issues before they fail your Quality Gate with our IDE extension SonarLint

Add a lock-free work-stealing deque (work_stealing_deque.h) for
per-thread task queues, and rework the worker loop around it:

- each thread keeps its own deque; enqueue_task() pushes worker
  tasks onto the owning thread's deque
- the worker loop drains the global queue, then its own deque, then
  steals from other threads' deques while unassigned work remains
- add work_stealing_deque::clear() so thread_pool::clear_tasks() can
  also empty the per-thread deques

Add deque unit tests, and update the matrix multiplication
benchmark and the mandelbrot example for the new API.
@ptsouchlos
ptsouchlos force-pushed the feature/lock-free-deque branch from 3b0b88f to d5bbcd2 Compare November 14, 2026 23:06

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants