Re: Suggestions on Avoiding syscall Overhead

From: Robert Watson <rwatson_at_FreeBSD.org>
Date: Mon, 30 Apr 2007 22:10:33 +0100 (BST)
On Mon, 30 Apr 2007, Dag-Erling Smørgrav wrote:

> Robert Watson <rwatson_at_FreeBSD.org> writes:
>
>> Unfortunately, this sort of thing can't be expressed using the standard 
>> APIs. This leaves us two choices: allow the behavior of standard APIs to be 
>> configured at some granularity, or introduce new APIs.  My feeling is we 
>> should prefer new APIs, and suggest that programmers use those.  Take a 
>> look at sys/sys/time.h:1.71 for an example of what might make sense.
>
> I'm not sure this is a good example.
>
> There is already a suitable extensible API: clock_gettime(), which is part 
> of SUSv3.  Define new CLOCK_* constants for requesting a faster, less 
> precise timecounter, and if you feel like it, submit it to X/Open for 
> inclusion in the next version of the SUS.

You didn't look at that CVS revision, did you?

The contrast being drawn here is between extending the API (that includes 
constants) and doing something like having environmental variables or other 
stuff change the definition of existing APIs (CLOCK_REALTIME, gettimeofday(), 
etc).

Robert N M Watson
Computer Laboratory
University of Cambridge
Received on Mon Apr 30 2007 - 19:10:33 UTC

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