> Bruce Momjian <[EMAIL PROTECTED]> writes:
> > A comment on microsecond delays using select(). Most Unix kernels run
> > at 100hz, meaning that they have a programmable timer that interrupts
> > the CPU every 10 milliseconds.
>
> Right --- this probably also explains my observation that some kernels
> seem to add an extra 10msec to the requested sleep time. Actually
> they're interpreting a one-clock-tick select() delay as "wait till
> the next clock tick, plus one tick". The actual delay will be between
> one and two ticks depending on just when you went to sleep.
>
The BSDI code would be pselect():
/*
* If poll wait was tiny, this could be zero; we will
* have to round it up to avoid sleeping forever. If
* we retry below, the timercmp above will get us out.
* Note that if wait was 0, the timercmp will prevent
* us from getting here the first time.
*/
timo = hzto(&atv);
if (timo == 0)
timo = 1;
--
Bruce Momjian | http://candle.pha.pa.us
[EMAIL PROTECTED] | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026