Embedded.com - Introduction to Rate Monotonic Scheduling

Embedded.com - Introduction to Rate Monotonic Scheduling -...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Ready for a change? Open | Close Your ad here. Buy Media Now All Articles Products Column Courses VirtuaLabs Webinars Login | Register Welcome Guest Embedded.com Introduction to Rate Monotonic Scheduling By Michael Barr Embedded Systems Design (02/28/02, 09:38:34 AM EST) If you've got a lot of tasks to do, and tight dead-lines to meet, what's the best way to prioritize them? The scheduling algorithm you choose depends on your goals. Different algorithms yield different results. Let's suppose you're given ten jobs and each will take a day to finish. In ten days, you will have all of them done. But what if one or more has a deadline? If the ninth task given to you has a deadline in three days, then doing the tasks in the order you receive them will cause you to miss that deadline. The purpose of a real-time scheduling algorithm is to ensure that critical timing constraints, such as deadlines and response time, are met. When necessary, decisions are made that favor the most critical timing constraints, even at the cost of violating others. Real-time scheduling is also used to allocate processor time between tasks in soft real-time embedded systems. Priority-based scheduling Many real-time systems use preemptive multitasking, especially those with an underlying real-time operating system (RTOS). Priorities are assigned to tasks, and the RTOS always executes the ready task with highest priority. In this case, the scheduling algorithm is the method in which priorities are assigned. Most algorithms are classified as fixed priority, dynamic priority, or mixed priority. A fixed-priority algorithm assigns all priorities at design time, and those priorities remain constant for the lifetime of the task. A dynamic-priority algorithm assigns priorities at runtime, based on execution parameters of tasks, such as upcoming deadlines. A mixed-priority algorithm has both static and dynamic components. Needless to say, fixed-priority algorithms tend to be simpler than algorithms that must compute priorities on the fly. To demonstrate the importance of a scheduling algorithm, consider a system with only two tasks, which we'll call t 1 and t 2 . Assume these are both periodic tasks with periods T 1 and T 2 , and each has a deadline that is the beginning of its next cycle. Task t 1 has T 1 = 50ms, and a worst-case execution time of C1 = 25ms. Task t 2 has T 2 = 100ms and C 2 = 40ms. Note that the utilization, U i , of task ti is C i /T i . Thus U 1 = 50% and U 2 = 40%. This means total requested utilization U = U 1 + U 2 = 90%. It seems logical that if utilization is less than 100%, there should be enough available CPU time to execute both tasks. Let's consider a static priority scheduling algorithm. With two tasks, there are only two possibilities: Case 1: Priority(t 1 ) > Priority(t 2 ) Case 2: Priority(t 1 ) < Priority(t 2 ) The two cases are shown in Figure1. In Case 1, both tasks meet their respective deadlines. In Case 2, however, t 1 misses a deadline, despite 10% idle time. This illustrates the importance of priority assignment.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 07/16/2009 for the course SYSC 3303 taught by Professor Shramp during the Spring '09 term at Carleton CA.

Page1 / 3

Embedded.com - Introduction to Rate Monotonic Scheduling -...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online