Rate Monotonic Problems

Joel Sherrill joel.sherrill at OARcorp.com
Wed Jun 14 11:54:16 UTC 2000



CARERI/SED wrote:
> 
> Hi,
> We have built rtems for target i960, and got it work on the board.
> We found there is problem in the case:
>         1.Define the  TICK  as 20ms.
>         2.Use a rate monotonic of 2 ticks in a task to insure that the task would be completed in 40ms
>    But the task consumes 53ms actually , and the rtems_rate_monotonic_period returns  "status" RTEMS_SUCCESSFUL., there are NO TIMEOUTs.
>          And I can only explain it as following:
>                 Whe the rtems_rate_monotonic_period returns  the Counting-Tick is 2, though the real time is 53ms, but it has not reached 60ms (3 ticks), so it return SUCCESSFUL, and meanwhile it set the Counting-Tick to 0, and so on.
> 
> Am I wrong? and What's your explanation?

Probably not.  Given a clock tick quantum of 20 milliseconds you are
always going to have significant error (<=19.999999 milliseconds) in
all times.  When you delay/period for 2 ticks that translates into
the remaining length of time until the next clock tick plus two 
others.  Lowering the length of each clock tick will help as will
syncing the top of the loop on a clock tick boundary.  This problem
is discussed in this section of the Classic API Guide:

http://www.oarcorp.com/rtems/betas/rtems-4.5.0-beta/online-docs/rtemsdoc-4.5-beta3/share/rtemsdoc/html/c_user/c_user00018.html

> A characteristic of interval timing is that the actual interval period may be a fraction of a tick less than the
> interval requested. This occurs because the time at which the delay timer is set up occurs at some time between
> two clock ticks. Therefore, the first countdown tick occurs in less than the complete time interval for a tick.
> This can be a problem if the clock granularity is large. 

 
> Sincerely,
> Su Wenming
> 
> 
> 

-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel at OARcorp.com                 On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
   Support Available             (256) 722-9985



More information about the users mailing list