Open In App

Generalized Real-time Task Scheduler

Improve
Improve
Like Article
Like
Save
Share
Report

Generalized Real-time Task Scheduler :
The scheduler used for handling or scheduling all the three types of real-time tasks i.e periodic, sporadic and aperiodic tasks, is known as Generalized task scheduler. It schedules periodic, sporadic and aperiodic tasks in most proficient way.

Why Generalized Task Scheduler?
Basically the cyclic scheduler is used for the accommodation of sporadic and aperiodic tasks but the arrival times of sporadic and aperiodic tasks are stated statistically. Therefore, aperiodic and sporadic tasks can not be assigned to the frames without significantly lessening the overall utilization of the system. Therefore, to schedule all the three types of tasks in a significant way, generalized task scheduler was introduced in real-time systems.
It is used to overcome the limitations of cyclic scheduler, event-driven, hybrid scheduler and all real-time task schedulers.

Working of Generalized Task Scheduler :
Generalized task scheduler initially prepares schedule for only periodic tasks i.e. time frames are assigned periodic tasks. Now sporadic and aperiodic tasks are scheduled in the slack time available in the frames after scheduling periodic tasks.
Slack time is the time left in a frame after a scheduled periodic task completed its execution. Slack time may be zero or non-zero. When the execution time of a periodic task is less than the frame size then slack time is non-zero.

Sporadic tasks can only be scheduled only if the enough slack time is available whereas in case of aperiodic tasks it is different. Sporadic tasks need to meet the deadline and in order to scheduled the sporadic tasks, acceptance test is performed to check the available slack time.
If the slack time is not enough, scheduler rejects the sporadic task. In case of aperiodic task, acceptance test is not needed. Aperiodic task does not need to meet the deadline, hence they are scheduled in available slack time.

Pseudo-code for Generalized task Scheduler :
Precomputed schedule for periodic tasks are stored in a table. It is assumed that sporadic tasks have gone through acceptance test and only eligible tasks are available.
Following is the pseudo code for generalized real-time task scheduler:

cyclic scheduler()
{
current-task T = Schedule-table[i];

i = i + 1;
i = i mod N;

// N is the total number of tasks
// in the schedule table

dispatch-current-task(T);

schedule-sporadic-task();
// Current task T completed early,
// sporadic tasks can be scheduled

schedule-aperiodic tasks;
// At the end, aperiodic tasks
// can be scheduled

idle();
// No task to be scheduled
}

Last Updated : 14 May, 2020
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads