|
static bool | kernelRun (raft::kernel *const kernel, volatile bool &finished, jmp_buf *gotostate=nullptr, jmp_buf *kernel_state=nullptr) |
|
Schedule::Schedule |
( |
Map & |
map | ) |
|
Schedule - base constructor takes a map object so that all sub-classes can access some of the map features through the schedule sub-class accessors.
- Parameters
-
destructor, takes care of cleanup
nothing to do at the moment
checkSystemSignal - check the incomming streams for the param kernel for any system signals, if there is one then consume the signal and perform the appropriate action.
- Parameters
-
kernel | - raft::kernel |
data | - void*, use this if any further info is needed in future implementations of handlers |
- Returns
- raft::kstatus, proceed unless a stop signal is received
TODO, right now there is special behavior for term signal only, what should we do with others? Need to decide that.
init - call to pre-process all kernels, this function is called by the map object befure calling start.
default, do nothing
kernelHasInputData - check each input port for available data, returns true if any of the input ports has available data.
- Parameters
-
- Returns
- bool - true if input data available.
only output ports, keep calling till exits
bool Schedule::kernelHasNoInputPorts |
( |
raft::kernel * |
kernel | ) |
|
|
staticprotected |
kernelHasNoInputPorts - pretty much exactly like the function name says, if the param kernel has no valid input ports (this function assumes that kernelHasInputData() has been called and returns false before this function is called) then it returns true. kernel - raft::kernel*
- Returns
- bool - true if no valid input ports avail
assume data check is already complete
bool Schedule::kernelRun |
( |
raft::kernel *const |
kernel, |
|
|
volatile bool & |
finished, |
|
|
jmp_buf * |
gotostate = nullptr , |
|
|
jmp_buf * |
kernel_state = nullptr |
|
) |
| |
|
static |
kernelRun - all the logic necessary to run a single kernel successfully. Any additional signal handling should be handled by this function as its the only one that will be universally called by the scheduler.
- Parameters
-
kernel | - raft::kernel *const object, non-null kernel |
finished | - volatile bool - function sets to true when done. |
- Returns
- true if run with no need for jmp_buf, false if the scheduler needs to run again with the kernel_state
must recheck data items again after port valid check, there could have been a push between these two conditional statements.
raft::kstatus Schedule::quitHandler |
( |
FIFO & |
fifo, |
|
|
raft::kernel * |
kernel, |
|
|
const raft::signal |
signal, |
|
|
void * |
data |
|
) |
| |
|
staticprotected |
quiteHandler - performs the actions needed when a port sends a quite signal (normal termination), this is most likely due to the end of data.
- Parameters
-
fifo | - FIFO& that sent the signal |
kernel | - raft::kernel* |
signal | - raft::signal |
data | - void*, vain attempt to future proof |
NOTE: This should be the only action needed currently, however that may change in the futre with more features and systems added.
scheduleKernel - adds the kernel "kernel" to the schedule, ensures that it is run. Other than that there are no guarantees for its execution. It is purely virtual in its implementation. Before you drop in a kernel, it better be ready to go..all allocations should be complete.
- Parameters
-
NOTE: The kernel param should be ready to rock, we just need to add it here. The data structures xx_kernels all expect a fully ready kernel, well the threads monitoring the system do at least and this is one. What we need to do to kick off the execution is add it to the handleSchedule virtual function which is implemented by each scheduler.
virtual void Schedule::start |
( |
| ) |
|
|
pure virtual |
start - called to start execution of all kernels. Implementation specific so it is purely virtual.
Implemented in pool_schedule, and simple_schedule.
kernelkeeper& Schedule::kernel_set |
|
protected |
The documentation for this class was generated from the following files: