Public Member Functions | Private Attributes | List of all members
art::GlobalTaskGroup Class Reference

#include <GlobalTaskGroup.h>

Public Member Functions

 GlobalTaskGroup (unsigned n_threads, unsigned stack_size)
 
template<typename T >
void run (T &&t)
 
void may_run (hep::concurrency::WaitingTaskPtr task, std::exception_ptr ex_ptr={})
 
tbb::task_group & native_group ()
 

Private Attributes

tbb::global_control threadControl_
 
tbb::global_control stackSizeControl_
 
tbb::task_group group_
 

Detailed Description

Definition at line 11 of file GlobalTaskGroup.h.

Constructor & Destructor Documentation

art::GlobalTaskGroup::GlobalTaskGroup ( unsigned  n_threads,
unsigned  stack_size 
)

Definition at line 3 of file GlobalTaskGroup.cc.

5  : threadControl_{tbb::global_control::max_allowed_parallelism, n_threads}
6  , stackSizeControl_{tbb::global_control::thread_stack_size, stack_size}
7 {}
tbb::global_control threadControl_
tbb::global_control stackSizeControl_

Member Function Documentation

void art::GlobalTaskGroup::may_run ( hep::concurrency::WaitingTaskPtr  task,
std::exception_ptr  ex_ptr = {} 
)

Definition at line 10 of file GlobalTaskGroup.cc.

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 }
def move(depos, offset)
Definition: depos.py:107
tbb::task_group group_
tbb::task_group& art::GlobalTaskGroup::native_group ( )
inline

Definition at line 27 of file GlobalTaskGroup.h.

28  {
29  return group_;
30  }
tbb::task_group group_
template<typename T >
void art::GlobalTaskGroup::run ( T &&  t)
inline

Definition at line 17 of file GlobalTaskGroup.h.

18  {
19  group_.run(std::move(t));
20  }
def move(depos, offset)
Definition: depos.py:107
tbb::task_group group_

Member Data Documentation

tbb::task_group art::GlobalTaskGroup::group_
private

Definition at line 35 of file GlobalTaskGroup.h.

tbb::global_control art::GlobalTaskGroup::stackSizeControl_
private

Definition at line 34 of file GlobalTaskGroup.h.

tbb::global_control art::GlobalTaskGroup::threadControl_
private

Definition at line 33 of file GlobalTaskGroup.h.


The documentation for this class was generated from the following files: