Re: Can't sleep less than 20 ms

Johan =?iso-8859-1?Q?Myr=E9en?= (johan.myreen@setec.fi)
Mon, 05 Jul 1999 13:53:09 +0000


Harald Koenig wrote:

> > I hate to cite it, but people should read the manpage before they
> > implement something. The manpage of select is quite clear about what the
> > timeout means:
> >
> > "timeout is an upper bound on the amount of time elapsed
> > before select returns."
> >
> > Thus select should return *before* timeout expires. Well, it doesn't
>
> sorry, but this way of reading makes no sense! in your reading it would
> be perfectly fine if select would return immediately, and it would be wrong
> if returning some usec after timeout.

I think the manual page wording makes perfect sense. The kernel is serving
the application, and it is in the interest of the application to get a
guarantee on the upper bound of the timeout. It is of course in the
interest of the _kernel_, whose task is to sensibly allocate the host's
resources to all processes, to make the timeout as long as possible (but
within bounds of the requested timeout.)

If we make 'timeout' the lower bound, then by the same logic it would be
perfectly fine for a conforming select to never return.

Johan Myreen
jem@iki.fi

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/