90 likes | 271 Views
Scheduling algorithms and priority inversion. Scheduling algorithms and priority inversion. What is real-time? Scheduling algorithms: Rate monotonic Deadline driven The priority inversion problem Conclusion. Scheduling algorithms.
E N D
Scheduling algorithms and priority inversion • What is real-time? • Scheduling algorithms: • Rate monotonic • Deadline driven • The priority inversion problem • Conclusion
Scheduling algorithms • A real-time system is one where the right results must be delivered on time. • Scheduling algorithm: the set of rules with which the activities are ordered for execution.
Scheduling algorithms • Rate monotonic: Assign the priority of each task according to its period, so that the shorter the period the higher the priority. Bad: Good:
Scheduling algorithms • Deadline driven: The next task to run is based on finding the task with the earliest deadline.
Priority inversion problem Conditions: • Concurrent tasks share a resource that is protected by e.g. a semaphore. • At least one intermediate priority task exists.
2 3 1 Priority inversion problem High Medium Low System Interrupt
Priority inversion problem Solutions: • Avoid sharing resources between tasks of differing priorities. • Turn off preemption of the low-priority task for the critical section. • The low-priority task could raise its own priority while in the critical section.
Conclusion The understanding of scheduling algorithms is of fundamental significance to developers of real-time applications.