Supplementing Generated C : Scheduler Package : Scheduling Policy

Scheduling Policy

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 calling sched_delay. The calling task then becomes delayed.
When a task calls a wait_for_event service. The calling task then becomes delayed.

sched_wait_for_event(EVENT)

event *EVENT;

Operations like sched_create_task, sched_start, sched_stop, sched_suspend and sched_resume do not cause rescheduling.