ADS
Algorithms and Data Structures
Toggle main menu visibility
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
"
79
#include "
ADS/concurrent/MPMCQueue.h
"
80
#include "
ADS/concurrent/MPSCQueue.h
"
81
#include "
ADS/parallel/Executor.h
"
82
#include "
ADS/parallel/FastFlowExecutor.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
99
namespace
ADS
100
{
101
134
template
<
class
T ,
class
R , WorkerExecutor E ,
class
S ,
class
O ,
class
W >
135
void
feedbackFarm
( E & ex , std::size_t w , S && start , O && onResult ,
136
W && work );
137
138
#if defined( ADS_WITH_FASTFLOW )
139
158
template
<
class
T ,
class
R ,
class
S ,
class
O ,
class
W >
159
void
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
/*--------------------------------------------------------------------------*/
Contract.h
The contracts of ADS: the preconditions, the postconditions and the invariants of the operations,...
Executor.h
The layer of execution of the parallel algorithms of ADS, beyond the book: an executor runs the calls...
FastFlowExecutor.h
The executor [see Executor.h] on the threads of FastFlow, beyond the book, compiled only with ADS_WIT...
MPMCQueue.h
A bounded queue of many producers and many consumers, beyond the book: the circular vector of Vyukov,...
MPSCQueue.h
A queue that many producer threads fill and one consumer thread empties, lock-free and unbounded,...
ADS::FastFlowExecutor
the executor on a ParallelFor of FastFlow
Definition
FastFlowExecutor.h:227
ADS::feedbackFarm
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 )),...
ADS
Definition
ADT.h:96
ADS
parallel
Farm.h
Generated by
1.17.0