C++ 20 Threadpool library.
Find a file
Jorijn van der Graaf 4631c18c31 port to crafter.build v2
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-06 01:06:09 +02:00
implementations namespace fix 2025-11-02 07:14:39 +01:00
interfaces namespace fix 2025-11-02 07:14:39 +01:00
tests/ShouldCompile port to crafter.build v2 2026-05-06 01:06:09 +02:00
.gitignore updated project 2025-05-07 19:10:22 +02:00
LICENSE initial commit 2025-02-17 22:31:53 +01:00
project.cpp port to crafter.build v2 2026-05-06 01:06:09 +02:00
readme.md initial commit 2025-02-17 22:31:53 +01:00

About

This is a threadpool library for C++ 20

How to use

#include <print>

import Crafter.Thread;
using namespace Crafter::Thread;

int main() {
    ThreadPool::Start(3);
    ThreadPool::Enqueue({[](){std::println("1");}, [](){std::println("2");}, [](){std::println("3");}, [](){std::println("4");}, [](){std::println("5");},[](){std::println("6");}, [](){std::println("7");}, [](){std::println("8");}, [](){std::println("9");}, [](){std::println("10");}});
    ThreadPool::Stop();
}

When running this above code the prints will be spread across 2 threads. This can be seen in the main.cpp sample by running crafter-build -c test -r