Xserver and Gettimeofday

Lukas Hejtmanek xhejtman at ics.muni.cz
Wed Aug 29 09:32:08 PDT 2007


On Wed, Aug 29, 2007 at 08:48:15AM -0700, Alan Coopersmith wrote:
> Xavier Bestel wrote:
>> That's curious, after having looked at the code it seems the smart
>> scheduler uses only setitimer, not gettimeofday.
>> So apparently your problem comes from the driver.
>
> GetTimeInMillis in os/utils.c was responsible for most of the
> gettimeofday() calls I knew of, but it was changed to use
> clock_gettime instead (on platforms that support it) last year.

I could be something missing, but gettimeofday() actually calls clock_gettime
syscall similarly to clock_gettime(3).

In general, there is nothing wrong with gettimeofday or clock_gettime, it just
must not be called too often (typically when waiting in busy loops).

-- 
Lukáš Hejtmánek



More information about the xorg mailing list