On 8/29/07, Philippe Gerum <[EMAIL PROTECTED]> wrote:
> On Wed, 2007-08-29 at 16:32 +0200, Jan Kiszka wrote:
> > Markus Osterried (BA/EDD) wrote:
> > > Hi,
> > >
> > > it seems that in the RTDM API, all the timeout functions which use
> > > nanosecs_rel_t have a strange behaviour.
> > > The timeout in nanoseconds is converted to ticks and the number of ticks
> > > is rounded down. So when we want to wait e.g. 500000 nanoseconds and the
> > > timertick is 1 ms, xnpod_ns2ticks() rounds down to 0. But 0 is the
> > > special value RTDM_TIMEOUT_INFINITE, so we wait forever. I use Xenomai
> > > 2.3.1, but I think it's basically the same in trunk.
> >
> > It should even impact other skins as well when in tick-based timing
> > mode. I would bet more users of xnpod_ns2ticks() may have overseen this
> > rounding issue - like RTDM did.
> >
>
> Other skins may only mean POSIX and native, since the other ones only
> deal with ticks.

AFAICT, the posix skin deals with this, most timeouts use
ts_2ticks_ceil(timeout)+1
which round the timeout (expressed as a struct timespec) to the next
tick, and add an additional tick to be sure to sleep at least the
specified duration, as required by the posix spec.

Of course, there may be places in the posix skin where I forgot about
this issue.
-- 
                                               Gilles Chanteperdrix

_______________________________________________
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core

Reply via email to