Reference documentation for deal.II version GIT 6dd81a2340 2022-11-29 05:55:02+00:00
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
Public Member Functions | Private Attributes | List of all members
Threads::TaskGroup< RT > Class Template Reference

#include <deal.II/base/thread_management.h>

Public Member Functions

TaskGroupoperator+= (const Task< RT > &t)
std::size_t size () const
void join_all () const

Private Attributes

std::list< Task< RT > > tasks

Detailed Description

template<typename RT = void>
class Threads::TaskGroup< RT >

A container for task objects. Allows to add new task objects and wait for them all together. The task objects need to have the same return value for the called function.

Note that the call to join_all() must be executed on the same thread as the calls that add subtasks. Otherwise, there might be a deadlock. In other words, a Task object should never passed on to another task for calling the join() method.

Definition at line 1643 of file thread_management.h.

Member Function Documentation

◆ operator+=()

template<typename RT = void>
TaskGroup& Threads::TaskGroup< RT >::operator+= ( const Task< RT > &  t)

Add another task object to the collection.

Definition at line 1650 of file thread_management.h.

◆ size()

template<typename RT = void>
std::size_t Threads::TaskGroup< RT >::size ( ) const

Return how many tasks have been put into this group. This function does not distinguish how many of these tasks have already run and have finished, are still waiting to be scheduled to a CPU resource, or are currently running. Tasks that have been joined already are also still counted.

Definition at line 1665 of file thread_management.h.

◆ join_all()

template<typename RT = void>
void Threads::TaskGroup< RT >::join_all ( ) const

Wait for all tasks in the collection to finish. It is not a problem if some of them have already been waited for, i.e. you may call this function more than once, and you can also add new task objects between subsequent calls to this function if you want.

Definition at line 1678 of file thread_management.h.

Member Data Documentation

◆ tasks

template<typename RT = void>
std::list<Task<RT> > Threads::TaskGroup< RT >::tasks

List of task objects.

Definition at line 1688 of file thread_management.h.

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