• <xmp id="om0om">
  • <table id="om0om"><noscript id="om0om"></noscript></table>
  • System Task Manager SDK Reference  5.10
    All Classes Files Functions Variables Typedefs Enumerations Enumerator Pages
    Schedule Manager

    Schedule Manager

    To switch between schedules during runtime, the user must create a Schedule Manager which resides in a single OS process and links to the shared library libstm_runtime.so. During system initialization, only one process can call stmScheduleManagerInit(). The Schedule Manager controls which schedule is executed at a certain point of time. It uses two APIs (present in stm_manager.h) to control the execution of the schedule:

    1. stmStartSchedule(uint16 t scheduleId): This starts the execution of the schedule corresponding to the input scheduleId. If no matching schedule is found, it will result in an error and STM will exit.
    2. stmStopSchedule(uint16 t scheduleId): This stops the execution of the schedule corresponding to the input scheduleId. If no matching schedule is found, or if the current executing schedule does not match the input scheduleId, it will result in an error and STM will exit.

    To exit gracefully, the process calling stmScheduleManagerInit() can call stmScheduleManagerExit(). For example, the application's SIGINT or SIGTERM handler can call stmScheduleManagerExit() to gracefully exit.

    Complete Swap Schedule Switch

    STM implements complete schedule switch as depicted in the figure below. Upon receiving a request for stopping the current schedule, each hyperepoch finishes executing its current frame and does not start the execution of the next frame. Schedule execution comes to a halt after all the hyperepochs stop. After that, based on the input from the STM Schedule Manager, execution can restart with a different schedule.

    Overview of Schedule Switch
    人人超碰97caoporen国产