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;
(top 24 of 37)
0 followers · starred Mar 2017
139 followers · starred Jul 2015
264 followers · starred Oct 2018
481 followers · starred Mar 2017
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;
(top 24 of 37)
0 followers · starred Mar 2017
139 followers · starred Jul 2015
264 followers · starred Oct 2018
481 followers · starred Mar 2017