ADS
Algorithms and Data Structures
Loading...
Searching...
No Matches
Farm.h
Go to the documentation of this file.
1/*--------------------------------------------------------------------------*/
2/*------------------------------ File Farm.h -------------------------------*/
3/*--------------------------------------------------------------------------*/
66/*--------------------------------------------------------------------------*/
67/*----------------------------- DEFINITIONS --------------------------------*/
68/*--------------------------------------------------------------------------*/
69
70#ifndef __ADS_Farm
71 #define __ADS_Farm
72/* self-identification: #endif constant */
73
74/*--------------------------------------------------------------------------*/
75/*------------------------------ INCLUDES ----------------------------------*/
76/*--------------------------------------------------------------------------*/
77
78#include "ADS/Contract.h"
83
84#include <atomic>
85#include <cstddef>
86#include <deque>
87#include <exception>
88#include <memory>
89#include <optional>
90#include <stdexcept>
91#include <type_traits>
92#include <utility>
93#include <vector>
94
95/*--------------------------------------------------------------------------*/
96/*--------------------------- NAMESPACE ------------------------------------*/
97/*--------------------------------------------------------------------------*/
98
99namespace ADS
100{
101
134template< class T , class R , WorkerExecutor E , class S , class O , class W >
135void feedbackFarm( E & ex , std::size_t w , S && start , O && onResult ,
136 W && work );
137
138#if defined( ADS_WITH_FASTFLOW )
139
158template< class T , class R , class S , class O , class W >
159void feedbackFarm( FastFlowExecutor & ex , std::size_t w , S && start ,
160 O && onResult , W && work );
161
162#endif
163
164/*--------------------------------------------------------------------------*/
165
166} // end( namespace ADS )
167
168/*--------------------------------------------------------------------------*/
169/*-------------------------- IMPLEMENTATION --------------------------------*/
170/*--------------------------------------------------------------------------*/
171
172#include "ADS/parallel/impl/Farm.tpp"
173
174/*--------------------------------------------------------------------------*/
175
176#endif /* Farm.h included */
177
178/*--------------------------------------------------------------------------*/
179/*---------------------------- End File Farm.h -----------------------------*/
180/*--------------------------------------------------------------------------*/
The contracts of ADS: the preconditions, the postconditions and the invariants of the operations,...
The layer of execution of the parallel algorithms of ADS, beyond the book: an executor runs the calls...
The executor [see Executor.h] on the threads of FastFlow, beyond the book, compiled only with ADS_WIT...
A bounded queue of many producers and many consumers, beyond the book: the circular vector of Vyukov,...
A queue that many producer threads fill and one consumer thread empties, lock-free and unbounded,...
the executor on a ParallelFor of FastFlow
Definition FastFlowExecutor.h:227
void feedbackFarm(E &ex, std::size_t w, S &&start, O &&onResult, W &&work)
the farm of a master and workers with feedback: start( emit ) (or start( emit , w )),...
Definition ADT.h:96