ADS
Algorithms and Data Structures
Loading...
Searching...
No Matches
ADS::SenderExecutor< Sch > Class Template Reference

the executor on a scheduler of the senders More...

#include <ADS/interop/parallel/SenderExecutor.h>

Public member functions

 SenderExecutor (Sch s, std::size_t p)
 the executor of the scheduler \( s \), which tells the algorithms of ADS that it has \( p \) threads
std::size_t concurrency (void) const
 the number of threads given to the constructor
const Sch & scheduler (void) const
 the scheduler
template<class F>
void bulk (std::size_t n, F &&f)
 the calls \( f( 0 ) , \ldots , f( n - 1 ) \) by a bulk sender on the scheduler, in order on the calling thread inside a call

Detailed description

template<stdexec::scheduler Sch>
class ADS::SenderExecutor< Sch >

the executor on a scheduler of the senders

Constructor and destructor documentation

◆ SenderExecutor()

template<stdexec::scheduler Sch>
ADS::SenderExecutor< Sch >::SenderExecutor ( Sch s,
std::size_t p )
inline

the executor of the scheduler \( s \), which tells the algorithms of ADS that it has \( p \) threads

Precondition
\( p \ge 1 \)

Member function documentation

◆ bulk()

template<stdexec::scheduler Sch>
template<class F>
void ADS::SenderExecutor< Sch >::bulk ( std::size_t n,
F && f )
inline

the calls \( f( 0 ) , \ldots , f( n - 1 ) \) by a bulk sender on the scheduler, in order on the calling thread inside a call

In pseudocode (beyond the book):

\[\class{pseudocode}{\begin{array}{r@{\quad}l} 1 & \textbf{procedure}\ \mathrm{bulk}( n , f ) \cr 2 & \quad \textbf{if}\ n \le 1\ \textbf{or}\ p = 1\ \textbf{or} \ \text{inside a call of the executor}\ \textbf{then} \cr 3 & \qquad \textbf{for}\ i \gets 0\ \textbf{to}\ n - 1\ \textbf{do} \ f( i ) \cr 4 & \quad \textbf{else}\ \mathrm{syncWait}( \mathrm{schedule}( s ) \mid \mathrm{bulk}( \mathit{par} , n , i \mapsto f( i ) \text{ marked inside} ) ) \cr 5 & \quad \text{throw again the first exception of the calls, if any} \end{array}} \]

◆ concurrency()

template<stdexec::scheduler Sch>
std::size_t ADS::SenderExecutor< Sch >::concurrency ( void ) const
inlinenodiscard

the number of threads given to the constructor

◆ scheduler()

template<stdexec::scheduler Sch>
const Sch & ADS::SenderExecutor< Sch >::scheduler ( void ) const
inlinenodiscard

the scheduler


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