[olsr-dev] Re: olsr bmf question
Andreas Tønnesen
(spam-protected)
Wed Dec 27 23:07:27 CET 2006
>
> The timeout parameter is passed to the select() call as a pointer, so
> it COULD return the remaining time there. In fact, IT DOES in linux,
> thus implementation of this scheme in linux is perfectly possible
> (I've done that before), but this is a particularity of linux. In
> fact, posix says the timeout return value of select() is undefined, so
> the problem would be the implementation on other operating systems.
I seem to remember having used this approach in olsrd earlier... Hmmm...
might
just be that I've planned on doing it that way. Anyways, yes, I think
using select
with a timeout instead of sleeping is a good idea. And as for the return
value
of the timeval I guess the best thing would be just to grab a timestamp
prior
to and after calling select(after if the FD set was set, and after the
data was
processed which would not be taken into account if just using the returned
timeval) and keep on calling select until the scheduler should kick in.
I do not believe this is something for the next release which will
mainly be a bugfix
release, but I agree it should be addressed pretty soon.
- Andreas
More information about the Olsr-dev
mailing list