A simple C++11 Thread Pool implementation
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;
Proposal for OpenHarmony Adaptation of [ ThreadPool ]
Thread pool function extension
bug
possible deadlock during ~ThreadPool
How can We Use A override member Function in threadpool enqueue ?
Unexpected stuck thread
a
Similar C implementation
How to add support for thread binding cpu_cores ?
Why not use std::atomic<bool> instead of bool?