Scheduling in Real time Systems


A real-time system comprises real tasks or applications which need to get processed without any delay. In this system, a time-bound approach is followed for fixed time constraints and the tasks have to be processed within the time constraints. This timing constraint is termed the deadline for real-time tasks. The requirements specified for real-time systems are given by timelines and predictability, where timelines denote how near/close the task to the deadline given is and predictability defines the amount of deviation that occurs in the timelines that are delivered.

Real-time Systems

Traditional scheduling algorithms like priority-based ones, give priority to some processes, based on the characteristics of the processes which are in the ready queue. As said earlier, real-time tasks need to be completed as per priority and should be processed within the given deadline or constraints. It also depends on a few more metrics such as feasibility which depicts whether the task can meet the requirements or not.

The next one is a hard real-time system which is an important requirement for the task to execute within the predefined intervals or response time and when this is not met by the real-time task then it may lead to system failure. The last metric is soft real-time tasks, where response time has to be achieved to the maximum and if the deadline is missed then it may degrade system performance and also lead to failures but they are recoverable. These soft tasks can be rescheduled to be completed at a later time.

Scheduling in real-time systems is an easier implementable approach with the following features of it −

  • Since the deadline is specified for each task before it gets processed, we may specify the period of the tasks, and based on this time sharing-based scheduling algorithm works more efficiently for real-time tasks than other algorithms

  • The traffic rate is constant as the workload is relatively fixed for the tasks, and this returns better utilization of CPU resources and provides the higher response time for hard real-time and soft real-time tasks.

  • The complexity of each task is relatively known, so when there exists a high demand, we may know which task is to be scheduled with low complexity, and starvation issues among the low-priority tasks are accepted during the real-time tasks processing period

Scheduling algorithms

A scheduler is not needed for the simpler real-time tasks as their process and execution time are known, so one task after its completion may call the other task on its own. But for complex systems in which large entities of tasks do not follow a proper pipeline, we may apply a static scheduling algorithm where a fixed timeline is provided to ensure the execution of the tasks that are in the ready queue. These approaches will not work for real-time systems which change their workload dynamically according to the events, here we need to apply a dynamic scheduling algorithm.

When dynamic scheduling is applied, we need to know what process is followed to choose the upcoming task to execute based on SJF, higher priority, completion time, etc, and how the overload issues are handled by providing adjustments in executing a smaller number of lower priority tasks and shedding methods.

Some of the scheduling algorithms used in real-time systems are −

  • Some of the scheduling algorithms used in real-time systems are − It is also called a non-preemptive method of multitasking, where the operating system does not initiate a context switch technique from one process in execution to another process or task. All the tasks have to equally cooperate for the scheduler to work.

  • Earliest Deadline first − It is a dynamic priority algorithm, where tasks are selected for execution based on the nearest deadline by referencing the priority queue.

  • Preemptive scheduling − When multitasking is performed, preemption can be made to the task which is in execution, and based on scheduler instruction, the next task is executed and the preempted task can be processed after some time, pushing it to the end of the ready queue.

  • Other algorithms which use a preemptive approach are round robin, rate-monotonic, fixed-priority preemptive scheduling, Fixed-Priority Non-preemptive scheduling, and static time scheduling.

Disadvantages

  • In real-time tasks, testing is a tedious process where each task has to be verified for its completion within the deadlines, and validating the same if any delay happens takes more time.

  • Resources needed for all the tasks assigned to meet its requirements may not be available in the system when there are several tasks to execute at the same time and thus resulting in starvation of resources.

  • Complexity is higher as real-time tasks must be analyzed in terms of requirements, deadlines, and resources.

Conclusion

Real-time systems execute the specified tasks with the needed deadline based on the time-sharing approach. It uses scheduling algorithms based on static or dynamic methods where the number of tasks and workload may vary. Preemptive or non-preemptive approaches are used to select the highest priority tasks to be executed first compared with the lower priority tasks.

Updated on: 18-Jul-2023

2K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements