GlobalTaskGroup.cc
Go to the documentation of this file.
2 
3 art::GlobalTaskGroup::GlobalTaskGroup(unsigned const n_threads,
4  unsigned const stack_size)
5  : threadControl_{tbb::global_control::max_allowed_parallelism, n_threads}
6  , stackSizeControl_{tbb::global_control::thread_stack_size, stack_size}
7 {}
8 
9 void
10 art::GlobalTaskGroup::may_run(hep::concurrency::WaitingTaskPtr task,
11  std::exception_ptr ex_ptr)
12 {
13  if (task->decrement_done_count() == 0u) {
14  group_.run([t = std::move(task), ex_ptr] {
15  t->dependentTaskFailed(ex_ptr);
16  (*t)();
17  });
18  }
19 }
tbb::global_control stackSizeControl_
GlobalTaskGroup(unsigned n_threads, unsigned stack_size)
def move(depos, offset)
Definition: depos.py:107
tbb::task_group group_
void may_run(hep::concurrency::WaitingTaskPtr task, std::exception_ptr ex_ptr={})