Скачиваний:
1
Добавлен:
01.03.2025
Размер:
2.14 Mб
Скачать
    1. Comparison of Cyclic with Table-Driven Scheduling

Both table-driven and cyclic schedulers are important clock-driven schedulers. A cyclic scheduler needs to set a periodic timer only once at the application initialization time. This timer continues to give an interrupt exactly at every frame boundary. But in table-driven scheduling, a timer has to be set every time a task starts to run. The execution time of a typical real-time task is usually of the order of a few milli Seconds. Therefore, a call to a timer is made every few mill Seconds. This represents a significant overhead and results in degraded system performance. Therefore, a cyclic scheduler is more efficient than a table-driven scheduler. This probably is a reason why cyclic schedulers are so overwhelmingly popular especially in embedded applications. However, if the overhead of setting a timer can be ignored, a table-driven scheduler is more proficient than a cyclic scheduler because the size of the frame that needs to be chosen should be at least as long as the size of the largest execution time of a task in the task set. This is a source of inefficiency, since this results in processor time being wasted in case of those tasks whose execution times are smaller than the chosen frame size.

  1. Hybrid Schedulers

We had seen that for clock-driven schedulers, the scheduling points are defined through clock interrupts and in case of event-driven schedulers these are defined by events such as arrival and completion of tasks. In hybrid schedulers, the scheduling points are defined both through the clock interrupts and the event occurrences. In the following, we discuss time-sliced round-robin scheduling — a popular hybrid scheduler.

Time-Sliced Round Robin Scheduling:

Time-sliced round robin schedulers are very commonly used in the traditional operating systems, and are profusely discussed in the standard operating systems books and in the available literature. We therefore keep our discussion on time-sliced round robin scheduling to the minimum. Time-sliced round robin scheduling is a preemptive scheduling method. In round robin scheduling, the ready tasks are held in a circular queue. The tasks are taken up one after the other in a sequence from the queue. Once a task is taken up, it runs for a certain fixed interval of time called its time slice. If a task does not complete within its allocated time slice, it is inserted back into the circular queue. A time-sliced round-robin scheduler is less proficient than table-driven or cyclic scheduler for scheduling real-time tasks. It is rather easy to see why this is so. A time-sliced round robin scheduler treats all tasks equally, and all tasks are assigned identical time slices irrespective of their priority, criticality, or closeness of deadline. So, tasks with short deadlines might fail to complete on time.

However, it is possible to consider task priorities in the time-sliced round-robin schedulers through a minor extension to the basic round robin scheme. The scheduler can assign larger time slices to higher priority tasks. In fact, the number of slices allocated to a task can be made proportional to the priority of the task. Even with this modification, time-sliced round-robin scheduling is far from satisfactory for real-time task scheduling (Can you identify the reasons?). In this case, the higher priority tasks are made to complete as early as possible. However, proficient real-time schedulers should try to meet the deadlines of as many tasks as possible, rather than completing the higher priority tasks in the shortest time.

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]