hpx/parallel/task_group.hpp#

See Public API for a list of names and headers that are part of the public HPX API.

namespace hpx
namespace execution#
namespace experimental#

Typedefs

using instead = hpx::experimental::task_group#
namespace experimental

Top-level namespace.

class task_group#
#include <task_group.hpp>

A task_group represents concurrent execution of a group of tasks. Tasks can be dynamically added to the group while it is executing.

Public Functions

task_group()#
~task_group()#
task_group(task_group const&) = delete#
task_group(task_group&&) = delete#
task_group &operator=(task_group const&) = delete#
task_group &operator=(task_group&&) = delete#
template<typename Executor, typename F, typename ...Ts>
inline void run(Executor &&exec, F &&f, Ts&&... ts)#

Adds a task to compute f() and returns immediately.

Template Parameters
  • Executor – The type of the executor to associate with this execution policy.

  • F – The type of the user defined function to invoke.

  • Ts – The type of additional arguments used to invoke f().

Parameters
  • exec – The executor to use for the execution of the parallel algorithm the returned execution policy is used with.

  • f – The user defined function to invoke inside the task group.

  • ts – Additional arguments to use to invoke f().

template<typename F, typename ...Ts>
inline void run(F &&f, Ts&&... ts)#

Adds a task to compute f() and returns immediately.

Template Parameters
  • F – The type of the user defined function to invoke.

  • Ts – The type of additional arguments used to invoke f().

Parameters
  • f – The user defined function to invoke inside the task group.

  • ts – Additional arguments to use to invoke f().

void wait()#

Waits for all tasks in the group to complete or be cancelled.

void add_exception(std::exception_ptr p)#

Adds an exception to this task_group.

Private Types

using shared_state_type = lcos::detail::future_data<void>#

Private Functions

void serialize(serialization::output_archive&, unsigned const)#

Private Members

hpx::lcos::local::latch latch_#
hpx::intrusive_ptr<shared_state_type> state_#
hpx::exception_list errors_#
std::atomic<bool> has_arrived_#

Private Static Functions

static inline constexpr void serialize(serialization::input_archive&, unsigned const) noexcept#

Friends

friend class serialization::access
struct on_exit#

Public Functions

explicit on_exit(task_group &tg)#
~on_exit()#
on_exit(on_exit const &rhs) = delete#
on_exit &operator=(on_exit const &rhs) = delete#
on_exit(on_exit &&rhs) noexcept#
on_exit &operator=(on_exit &&rhs) noexcept#

Public Members

hpx::lcos::local::latch *latch_#