14 int const num_threads = std::max(
size, 1) - 1;
18 for (
int i = 0; i < num_threads; ++i) {
29 std::scoped_lock lk(
_lock);
43 std::unique_lock lk2(
_lock);
62 int const thread_count =
size();
64 std::unique_lock lk(
_lock);
std::function< void(global_id, local_id)> dispatch_func
global_id _available_work
void execute_batch(std::unique_lock< std::mutex > &lk, local_id id, int thread_count)
std::condition_variable _completed_cv
global_id _completed_work
void thread_func(local_id id)
void dispatch(int count, dispatch_func function)
std::condition_variable _available_cv
std::vector< std::thread > _threads
std::mutex _dispatch_lock
Helper class to stream background task notifications as a series of messages.