progschj/ThreadPool

A simple C++11 Thread Pool implementation

C++

8,824

28 commits

updated Jul 20, 2024

See the code

README

ThreadPool

A simple C++11 Thread Pool implementation.

Basic usage:

// create thread pool with 4 worker threads
ThreadPool pool(4);

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

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

progschj/ThreadPool

A simple C++11 Thread Pool implementation

C++

8,824

28 commits

updated Jul 20, 2024

See the code

README

ThreadPool

A simple C++11 Thread Pool implementation.

Basic usage:

// create thread pool with 4 worker threads
ThreadPool pool(4);

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

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

Significant stargazers

(top 24 of 37)

Cong Ding

0 followers · starred Mar 2017

Soonho Kong

139 followers · starred Jul 2015

YangKeao

264 followers · starred Oct 2018

Jonas Devlieghere

481 followers · starred Mar 2017