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

Martin Erik Werner martinerikwerner.aac at gmail.com
Wed May 8 07:47:52 UTC 2019


On Mon, 2019-05-06 at 08:28 +0200, Sebastian Huber wrote:
> 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.

Ok, good. As long as it is known I expect it can fairly easily be
accounted for.

-- 
Martin Erik Werner
Software Engineer | ÅAC Microtec AB | Clyde Space Ltd.
aacmicrotec.com/privacy-policy



More information about the users mailing list