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 - ConorWilliams/Threadpool: Light, fast, threadpool for C++20

BranchesTags
Open more actions menu

Latest commit

 

History

43 Commits
43 Commits

Folders and files

NameName
Last commit message
Last commit date
benchmark
benchmark
 
 
cmake
cmake
 
 
include/riften
include/riften
 
 
test
test
 
 
.clang-format
.clang-format
 
 
.cmake-format
.cmake-format
 
 
.gitignore
.gitignore
 
 
CMakeLists.txt
CMakeLists.txt
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 

Repository files navigation

riften::Thiefpool

A blazing-fast, lightweight, work-stealing thread-pool for C++20. Built on the lock-free concurrent riften::Deque.

Usage

#include "riften/thiefpool.hpp"

// Create thread pool with 4 worker threads.
riften::Thiefpool pool(4);

// Enqueue and return future.
auto result = pool.enqueue([](int x) { return x; }, 42);

// Get result from future.
std::cout << result.get() << std::endl;

Additionally, riften::Thiefpool supplies a detaching version of enqueue:

// Enqueue and return nothing
pool.enqueue_detach([](int x) { do_work(x); }, x);

Which elides the allocation of a std::future's shared state.

Installation

The recommended way to consume this library is through CPM.cmake, just add:

CPMAddPackage("gh:ConorWilliams/Threadpool#v2.1.1")

to your CMakeLists.txt and you're good to go!

Tests

To compile and run the tests:

mkdir build && cd build
cmake ../test
make && make test

About

Light, fast, threadpool for C++20

Topics

cpp20lock-freethreadpoolwork-stealing

Resources

Readme
MPL-2.0 license
Activity

Stars

118 stars

Watchers

5 watching

Forks

9 forks
Report repository

Releases

Contributors

Languages

You are visitor 01402503 — 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.