svn commit: r237434 - in head/lib/libc: amd64/sys gen i386/sys include sys

Marius Strobl marius at alchemy.franken.de
Fri Jun 22 07:34:58 UTC 2012


On Fri, Jun 22, 2012 at 07:13:31AM +0000, Konstantin Belousov wrote:
> Author: kib
> Date: Fri Jun 22 07:13:30 2012
> New Revision: 237434
> URL: http://svn.freebsd.org/changeset/base/237434
> 
> Log:
>   Use struct vdso_timehands data to implement fast gettimeofday(2) and
>   clock_gettime(2) functions if supported. The speedup seen in
>   microbenchmarks is in range 4x-7x depending on the hardware.
>   
>   Only amd64 and i386 architectures are supported. Libc uses rdtsc and
>   kernel data to calculate current time, if enabled by kernel.

I don't know much about x86 CPUs but is my understanding correct
that TSCs are not synchronized in any way across CPUs, i.e.
reading it on different CPUs may result in time going backwards
etc., which is okay for this application though?

Marius



More information about the svn-src-head mailing list