51 return tbb::is_current_task_group_canceling();
59tbb::global_control *TaskScheduler::global_control =
nullptr;
70 if (num_threads > 0) {
72 VLOG_INFO <<
"Overriding number of TBB threads to " << num_threads <<
".";
73 global_control =
new tbb::global_control(tbb::global_control::max_allowed_parallelism,
87 delete global_control;
88 global_control =
nullptr;
133 queue.emplace_front(std::move(task));
136 queue.emplace_back(std::move(task));
189 while (queue.empty() && !
do_exit) {
198 task = queue.front();
226 int done = queue.size();
thread_condition_variable num_cond
void num_decrease(int done)
void push(TaskRunFunction &&run, bool front=false)
thread_condition_variable queue_cond
bool thread_wait_pop(TaskRunFunction &task)
static void free_memory()
static void init(int num_threads=0)
static thread_mutex mutex
static int active_num_threads
static int max_concurrency()
#define CCL_NAMESPACE_END
CCL_NAMESPACE_BEGIN string string_printf(const char *format,...)
string full_report() const
void push(TaskRunFunction &&task)
tbb::task_group tbb_group
void wait_work(Summary *stats=NULL)
function< void(void)> TaskRunFunction
std::unique_lock< std::mutex > thread_scoped_lock
CCL_NAMESPACE_BEGIN typedef std::mutex thread_mutex
CCL_NAMESPACE_BEGIN double time_dt()