rtems_task_wake_after()/usleep() sleeping less than requested?

Sebastian Huber sebastian.huber at embedded-brains.de
Mon May 6 06:28:00 UTC 2019

On 18/04/2019 13:41, Martin Erik Werner wrote:
> With our custom bsp of rtems (based on sparc/leon3 from 4.11.3) we are
> observing that rtems_task_wake_after() and usleep() quite often sleeps
> less than the requested amount when measured
> with rtems_clock_get_uptime_nanoseconds() timestamps.
> Is this expected behaviour for sleep in rtems or is this indicative of
> some issue in our bsp (possibly in the realms of our clock driver,
> either affecting the actual sleep or the measurement, or both).

For rtems_task_wake_after() this is the intended behaviour, however, the 
documentation could be more clear about this.

> The opengroup specification of usleep() indicates that it should always
> sleep equal to or more than the requested time, provided no signals:
> http://pubs.opengroup.org/onlinepubs/009695399/functions/usleep.htm

I think this was fixed in RTEMS 5.1. It is infeasible to back port this 
fix to RTEMS 4.11.

Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
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