FW: Accuracy of rtems_timer_server_fire_after

Sebastian Huber sebastian.huber at embedded-brains.de
Wed Jul 11 07:13:54 UTC 2012


On 07/10/2012 03:20 PM, Mogens Dybæk Christensen wrote:
> Hello Sebastian
>
> At first I set the timer server priority to 5. I then tried to give it priority 1 (apparently the highest possible, 0 is not allowed). It changes nothing.
>
> At least the first shot with rtems_timer_server_fire_after is very slow. - Have no measurements yet for the following ones, but I can add more test code.

You can set a break point to _Thread_Delay_ended() and step to your timer 
routine.  This should reveal the execution path and show the reason for the delay.

>
> As mentioned before, delays made with rtems_task_wake_after are more accurate.
>
> It seems that the main loop in the timer server itself uses a timer to wait before next check/action, but I did not understand it all at first glance.  :-)
>   The server code is in  rtems/cpukit/rtems/src/timerserver.c. How fast (and accurate) is the timer server intended to be,

The timer server works with clock tick granularity for 
rtems_timer_server_wake_after() and with seconds granularity for 
rtems_timer_server_wake_when().  You should only observe a small delay due to 
the task switch once a server timer is triggered.

> and can the prescaling from clock tick to server invocation be changed?

Not easily, this would require some changes in the timer server code.

-- 
Sebastian Huber, embedded brains GmbH

Address : Obere Lagerstr. 30, D-82178 Puchheim, Germany
Phone   : +49 89 18 90 80 79-6
Fax     : +49 89 18 90 80 79-9
E-Mail  : sebastian.huber at embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.





More information about the users mailing list