RTOS Myth #2: RMA is for Academics

Thursday, March 6th, 2008 by Michael Barr

The Myth: The Rate Monotonic Algorithm (RMA) is an interesting theory but it has no practical meaning for users of real-time operating systems.

The Truth: For starters,

  • All of the popular real-time operating systems (e.g., VxWorks, ThreadX, and uC/OS-II) feature fixed-priority preemptive schedulers
  • RMA is the optimal fixed-priority scheduling algorithm (and note that dynamic-priority algorithms do not degrade gracefully)
  • Unless you use RMA to assign priorities to RTOS tasks, there are no task-specific performance guarantees; if the processor becomes overly busy in a brief period of time, a critical task may miss its deadline

In a nutshell, RMA is the one and only proper way to assign relative priorities to RTOS tasks with deadlines. (Shock of shocks: Deferring to your boisterous colleague Bill’s insistence that his task is the most important isn’t guaranteed to work!) There’s a nice introduction to the RMA technique at http://www.netrino.com/Embedded-Systems/How-To/RMA-Rate-Monotonic-Algorithm/.

The principal benefit of RMA is that the performance of a set of tasks thus prioritized degrades gracefully. Your key “critical set” of tasks can be guaranteed (even proven a priori) to always meet its deadlines–even during periods of transient overload. Dynamic-priority operating systems cannot make this guarantee. Nor can static-priority RTOSes running tasks prioritized in other ways.

Too many of today’s real-time systems built with an RTOS are working by accident. Excess processing power can mask a lot of design sins. But if you haven’t used RMA to assign priorities, it could just be a matter of time before you get burned.

Go back to RTOS Myth #1 or forward to RTOS Myth #3.

Tags: , , ,

2 Responses to “RTOS Myth #2: RMA is for Academics”

  1. Michael Barr says:

    Here’s an example of the misconception in action. A professor at Vanderbilt University teaches a course about embedded systems, in which he states (slide 6 at the PDF linked below) that a system utilizing 68% or less of the CPU’s cycles is “Safe” and acceptable for a “High Consequence” system.http://eecs.vanderbilt.edu/Courses/ee276/Fall06_lectures/02%20Events%20and%20determinism.pdfThe percentage 68% is ONLY meaningful IF the rate monotonic algorithm has been used to prioritize the tasks and the worst-case analysis is properly done.

  2. Andrew says:

    I’ve previously worked for a company selling a DMA (= Deadline Monotonic Analysis) solution, a close relative of RMA. The key piece of information that’s really needed to do RMA or DMA is Worst-Case Execution Time (WCET). Funnily enough, I now work for a company that sells a WCET solution. http://www.RapitaSystems.com if you’re interested.

Leave a Reply