zelos.scheduler module¶
-
class
zelos.scheduler.
Scheduler
(threads, emu)¶ Bases:
object
Handles the pausing and stopping of execution of threads in Zelos.
There are subtlties here due to how changing EIP prevents zebracorn from stopping appropriately. Specifically, changing EIP while also calling stop may invalidate the stop.
-
stop
(stop_reason: str) → None¶ Stops execution of the running processes, exiting the run loop. If there is no process running, this will prevent the next run.
- Parameters
stop_reason – A string passed in for debugging purposes to indicate what caused Zelos to stop.
-
stop_and_exec
(stop_reason: str, should_continue: Callable[[], bool]) → None¶ Stops execution of the running proesses in order to run the provided closure. If the should_continue closure returns True, execution will continue, otherwise the run loop will be exited.
- Parameters
stop_reason – A string passed in for debugging purposes to indicate what caused Zelos to stop.
should_continue – A closure that is run after the running process is stopped. We should
-