class
WorkerInterfaceclass to configure worker behavior in an executor
The tf::
for(size_t n=0; n<num_workers; n++) { create_thread([](Worker& worker)
pre-processing executor-specific worker information ...
enter the scheduling loop Here, WorkerInterface::
while(1) { perform_work_stealing_algorithm(); if(stop) { break; } }
leaves the scheduling loop and joins this worker thread Here, WorkerInterface::
Constructors, destructors, conversion operators
- ~WorkerInterface() defaulted virtual
- default destructor
Public functions
- void scheduler_prologue(Worker& worker) pure virtual
- method to call before a worker enters the scheduling loop
-
void scheduler_epilogue(Worker& worker,
std::
exception_ptr ptr) pure virtual - method to call after a worker leaves the scheduling loop
Function documentation
void tf:: WorkerInterface:: scheduler_prologue(Worker& worker) pure virtual
method to call before a worker enters the scheduling loop
Parameters | |
---|---|
worker | a reference to the worker |
The method is called by the constructor of an executor.
void tf:: WorkerInterface:: scheduler_epilogue(Worker& worker,
std:: exception_ptr ptr) pure virtual
method to call after a worker leaves the scheduling loop
Parameters | |
---|---|
worker | a reference to the worker |
ptr | an pointer to the exception thrown by the scheduling loop |
The method is called by the constructor of an executor.