Re: latency error (~2ms) with nanosleep

From: Eric Piel
Date: Mon Jun 13 2005 - 09:30:19 EST


06/13/2005 04:21 PM, Richard B. Johnson wrote/a Ãcrit:

nanosleep, according to the documation is supposed to sleep
"at least" the 'struct timespec' time. It can return in
a shorter time as a result of a signal and, if so, the
input time-values will be updated accordingly. The resolution
is limited to the HZ value. This means that it will, unless
interrupted, always sleep at least 1 / HZ seconds (about 1 ms
on current x86 distributions).

FYI, there is no 'fine resolution' timer available on any
Linux-ported platform that could take advantage of the nanosecond
input resolution of the function.

I could add that there is a project working on this issue: high-resolution timers . You can download patches for 2.6 and 2.4 . The precision is in the order of 10 or 100 Âs.

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