aGrUM 2.3.2
a C++ library for (probabilistic) graphical models
gum::threadsSTL::ThreadExecutor Struct Reference

#include <threadExecutorSTL.h>

Inheritance diagram for gum::threadsSTL::ThreadExecutor:
Collaboration diagram for gum::threadsSTL::ThreadExecutor:

Static Public Member Functions

template<typename FUNCTION, typename... ARGS>
static void execute (std::size_t nb_threads, FUNCTION exec_func, ARGS &&... func_args)
 executes a function using several threads
template<typename FUNC1, typename FUNC2, typename... ARGS>
static void executeOrUndo (std::size_t nb_threads, FUNC1 exec_func, FUNC2 undo_func, ARGS &&... func_args)
 executes in parallel a function and undoes it if execptions are raised
static int nbRunningThreadsExecutors ()
 indicates how many threadExecutors are currently running

Static Private Attributes

static std::atomic< int > nbRunningThreadsExecutors_ {0}
 he number of currently running ThreadExecutors

Detailed Description

Definition at line 81 of file threadExecutorSTL.h.

Member Function Documentation

◆ execute()

◆ executeOrUndo()

template<typename FUNC1, typename FUNC2, typename... ARGS>
void gum::threadsSTL::ThreadExecutor::executeOrUndo ( std::size_t nb_threads,
FUNC1 exec_func,
FUNC2 undo_func,
ARGS &&... func_args )
static

executes in parallel a function and undoes it if execptions are raised

◆ nbRunningThreadsExecutors()

Member Data Documentation

◆ nbRunningThreadsExecutors_

std::atomic< int > gum::ThreadExecutorBase::nbRunningThreadsExecutors_ {0}
staticprotectedinherited

he number of currently running ThreadExecutors

Definition at line 78 of file threadExecutorBase.h.

Referenced by nbRunningThreadsExecutors().


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