Xserver and Gettimeofday

Daniel Stone daniel at fooishbar.org
Wed Aug 29 09:13:05 PDT 2007


On Wed, Aug 29, 2007 at 06:09:57PM +0200, Xavier Bestel wrote:
> On Wed, 2007-08-29 at 08:48 -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.
> 
> Curious, when stracing clock_gettime() I get a syscall, so what's the
> gain ?

The aim of clock_gettime wasn't to reduce syscall load, but to get us a
proper monotonic clock source, so your screensaver doesn't kick in as
soon as you change the time.

Cheers,
Daniel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.x.org/archives/xorg/attachments/20070829/e65ec07c/attachment.pgp>


More information about the xorg mailing list