Re: Suggestions on Avoiding syscall Overhead

From: Robert Watson <rwatson_at_FreeBSD.org>
Date: Tue, 24 Apr 2007 13:25:06 +0100 (BST)
On Mon, 23 Apr 2007, David G Lawrence wrote:

>   gettimeofday(2) returns microsecond precision, so I don't see how this 
> could be made accelerated via a mapped global page. time(3) [which is 
> currently a wrapper for gettimeofday(2)], on the other had, could be put 
> into such a page since it only updates once a second.

If we do this, we will need to be careful, perhaps just in documentation, as 
it leads to non-monotonicity if multiple time sources are queried 
sequentially.

On systems with reliable hardware characteristics, such as in Mac OS X, 
precision time querying is supported by providing a kernel-exported estimate 
of the TSC->realtime rate and offset.  This allows zero-system call querying 
of quite accurate time information.  I believe in Mac OS X, this information 
is exported using a shared memory page so that the cost of getting that 
information is also low.

Robert N M Watson
Computer Laboratory
University of Cambridge
Received on Tue Apr 24 2007 - 10:25:07 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:09 UTC