Re: gettimeofday() resolution in Linux?

From: Andi Kleen
Date: Thu Apr 10 2008 - 11:36:25 EST


lsorense@xxxxxxxxxxxxxxxxxxx (Lennart Sorensen) writes:
>
> On many systems gettimeofday uses the TSC, but on many multicore systems
> the TSC on each core may be out of sync, in which case the cpu you are
> running on may give a different gettimeofday result than another cpu,
> which is probably a bad thing for some processes.

In this case Linux falls back to other timers which are slower and
less accurate.

jiffies based gettimeofday is theoretically possible, but near
never used.

-Andi
--
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/