From owner-freebsd-current@FreeBSD.ORG Mon Oct 31 10:26:41 2005 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CEEC616A41F; Mon, 31 Oct 2005 10:26:41 +0000 (GMT) (envelope-from phk@critter.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.FreeBSD.org (Postfix) with ESMTP id D181043D49; Mon, 31 Oct 2005 10:26:40 +0000 (GMT) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (unknown [192.168.48.2]) by phk.freebsd.dk (Postfix) with ESMTP id AB805BC84; Mon, 31 Oct 2005 10:26:38 +0000 (UTC) To: David Xu From: "Poul-Henning Kamp" In-Reply-To: Your message of "Mon, 31 Oct 2005 18:18:35 +0800." <4365EF7B.1020706@freebsd.org> Date: Mon, 31 Oct 2005 11:26:38 +0100 Message-ID: <81213.1130754398@critter.freebsd.dk> Sender: phk@critter.freebsd.dk Cc: Alexander Leidinger , freebsd-current@freebsd.org, Robert Watson Subject: Re: TSC instead of ACPI: powerd doesn't work anymore (to be expected?) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Oct 2005 10:26:42 -0000 In message <4365EF7B.1020706@freebsd.org>, David Xu writes: >Robert Watson wrote: >> >> >> It has been suggested that the former can operate quite well with >> significantly reduced quality. It has alos been suggested that most >> applications could operate fine with somewhat reduced quality, but that >> the API definitions don't say anything about how to specify application >> quality requirements vs performance requirements for time measurement. > >Can we change gettimeofday and clock_gettime to lower resolution now? I can live with gettimeofday(2) and time(3) being degraded. I am going to insist that clock_gettime(CLOCK_REALTIME, CLOCK_UPTIME) remain precise. >I think 1000hz/s is enough for most applications, since a thread can >never sleep shorter than a tick for years. (Famous last words!) Time is not just a matter of sleeping. >We can introduce >hrtime_t clock_gethrtime(clockid_t clock) to get hi-resolution time >as the one seen in RTLinux, or gethrtime() as seen in Solaris (Daniel >Eischen said?) You know ? This is just a great example of why people feel the autocrap tools is the way to write portable code :-( The open group specifically allow clock_gettime() to implement more timescales, so what did those fools go and invent even more library functions for ? Poul-Henning -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence.