The context switch between tasks is done only in the following synchronization points:
● When a task explicitly calls the scheduler. This is done by calling the following routine:
scheduler
(
If there are other ready tasks - one of them (chosen in a round-robin manner) becomes current, while the calling task becomes ready. If there is no other task ready, the calling task continues its execution.
● When a task issues a delay request by callingsched_delay
. The calling task then becomes delayed.
● When a task calls await_for_event
service. The calling task then becomes delayed.
●Operations like
sched_create_task
,sched_start
,sched_stop
,sched_suspend
andsched_resume
do not cause rescheduling.