3 #include <util/threadpool/TaskDropper.h>
73 typename ThreadPoolType,
77 public TaskDropper<TaskType, ThreadPoolType, TaskArgs...>
189 std::max<int>(1, this->
maxTasks + sign * delta1Bud),
212 #ifdef BUDDING_METRICS
213 bool &debugBuddingMetrics,
217 long const idleTh=100000,
218 long const idleEps=100000
221 #ifdef BUDDING_METRICS
222 debugBuddingMetrics=
false;
226 #ifdef BUDDING_METRICS
227 debugBuddingMetrics=
true;
231 bool const sigChange = std::abs(idle-lastIdle) > idleEps;
234 if(sign == 0) sign = 1;
The budding task dropper is a task dropper which implements the logic for its own reproduction so bud...
Definition: BuddingTaskDropper.h:78
virtual int getDelta2() const
Obtain the of the budding task dropper.
Definition: BuddingTaskDropper.h:269
BuddingTaskDropper(int const maxTasks=32, int const delta1=8, int const initDelta1=8, int const delta2=1, char const lastSign=0)
Default constructor for the budding task dropper.
Definition: BuddingTaskDropper.h:124
BudType emptyClone() const
Do an empty clone of this budding task dropper. It is, an exact clone but with an empty tasks vector.
Definition: BuddingTaskDropper.h:145
virtual char getLastSign() const
Obtain the last sign of the budding task dropper.
Definition: BuddingTaskDropper.h:250
virtual int getInitDelta1() const
Obtain the init value of of the budding task dropper.
Definition: BuddingTaskDropper.h:263
virtual BudType evolve(long &lastIdle, long const idle, long const idleTh=100000, long const idleEps=100000)
Create the bud of current budding task dropper according to the defined evolutive criteria.
Definition: BuddingTaskDropper.h:211
int delta1
Magnitude of increase/decrease for max tasks.
Definition: BuddingTaskDropper.h:91
char lastSign
Must be at initial instance but then it should be either or .
Definition: BuddingTaskDropper.h:110
virtual int getDelta1() const
Obtain the of the budding task dropper.
Definition: BuddingTaskDropper.h:256
int delta2
Magnitude of increase/decrease for .
Definition: BuddingTaskDropper.h:105
virtual BudType reproduce(char const sign)
Do the budding reproduction of current task dropper.
Definition: BuddingTaskDropper.h:164
int initDelta1
The initial value of .
Definition: BuddingTaskDropper.h:95
Class which handles tasks dropping. It is, executing and then removing each task when dropping.
Definition: TaskDropper.h:22
size_t maxTasks
Specify the maximum number of tasks before forcing a drop.
Definition: TaskDropper.h:39