GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - jasoneplumb/taskloom: Work-stealing task queue and supporting concurrency modules in modern C++

BranchesTags
Open more actions menu

Latest commit

 

History

15 Commits
15 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
bench
bench
 
 
docs
docs
 
 
include/taskloom
include/taskloom
 
 
tests
tests
 
 
.clang-format
.clang-format
 
 
.gitignore
.gitignore
 
 
CMakeLists.txt
CMakeLists.txt
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 

Repository files navigation

taskloom

CI License: MIT C++20

A small header-only C++20 concurrency library centered on a work-stealing deque, with the supporting modules a task scheduler needs around one.

taskloom is not a scheduler or a thread pool: it is the data structures a scheduler is assembled from. Each header is usable on its own, depends only on the standard library, and documents its memory-ordering contract in place.

Modules

  • taskloom/wsq.hpp: Chase-Lev work-stealing deque: one owner pushes and pops, any number of thieves steal, lock-free stealing with safe ring growth
  • taskloom/rwlock.hpp: reader-writer spinlock with a seq_cst acquisition protocol; composes with std::shared_lock and std::unique_lock
  • taskloom/event.hpp: dependency-graph completion nodes: a node fires once its last prerequisite completes, with race-safe edge addition
  • taskloom/stats.hpp: constant-space streaming statistics whose merge preserves variance across threads
  • taskloom/atomic.hpp: padded<T> false-sharing isolation and lock-free compile-time guarantees
  • taskloom/hw.hpp: cache-line and page constants, spin hint, tick counter

Quick start

include(FetchContent)
FetchContent_Declare(taskloom
  GIT_REPOSITORY https://github.com/jasoneplumb/taskloom.git
  GIT_TAG v0.1.0
)
FetchContent_MakeAvailable(taskloom)
target_link_libraries(app PRIVATE taskloom::taskloom)
#include <taskloom/wsq.hpp>

taskloom::wsq<Task*> queue;

// Owner thread:
queue.push(task);
if (auto mine = queue.pop()) { run(*mine); }

// Any other worker:
if (auto stolen = queue.steal()) { run(*stolen); }

Dependency tracking with event:

#include <taskloom/event.hpp>

struct node : taskloom::event {
  void on_ready() noexcept override { /* every prerequisite completed */ }
};

node upload, shaders, frame;
frame.depends_on(upload);
frame.depends_on(shaders);
upload.complete();
shaders.complete();  // Last prerequisite: frame.on_ready() fires here.

Building and testing

cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --parallel
ctest --test-dir build --output-on-failure

Tests run under ThreadSanitizer with -DTASKLOOM_SANITIZE=thread; CI covers macOS, Linux, and Windows (MSVC) plus a TSan job. Benchmarks live in bench/ and are conservation-checked: a reported number is a verified number.

Design

Trade-off rationale and same-machine measurements, including the comparison against a mutex-guarded std::deque, are in docs/design.md.

License

MIT

About

Work-stealing task queue and supporting concurrency modules in modern C++

Topics

concurrencycppcpp20dequeheader-onlylock-freethreadingwork-stealing

Resources

Readme
MIT license
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.