From owner-freebsd-arch Mon Apr 15 16:29:58 2002 Delivered-To: freebsd-arch@freebsd.org Received: from swan.prod.itd.earthlink.net (swan.mail.pas.earthlink.net [207.217.120.123]) by hub.freebsd.org (Postfix) with ESMTP id 2203A37B405; Mon, 15 Apr 2002 16:29:53 -0700 (PDT) Received: from pool0600.cvx21-bradley.dialup.earthlink.net ([209.179.194.90] helo=mindspring.com) by swan.prod.itd.earthlink.net with esmtp (Exim 3.33 #1) id 16xFux-0004ba-00; Mon, 15 Apr 2002 16:29:52 -0700 Message-ID: <3CBB6252.6BAA4E90@mindspring.com> Date: Mon, 15 Apr 2002 16:29:22 -0700 From: Terry Lambert X-Mailer: Mozilla 4.7 [en]C-CCK-MCD {Sony} (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Poul-Henning Kamp Cc: arch@freebsd.org Subject: Re: get{bin,micro,nano}[up]time() - what precision ? References: <54342.1018890897@critter.freebsd.dk> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Poul-Henning Kamp wrote: > I'm soliciting input from users of the get*time() family of functions > in the kernel on what the minimal desirable precision is. > > Currently they return a timestamp which is no more than 1/HZ out > of date. For contemporary values of HZ, that seems to be adequate. > > As people increase HZ to above 10000, it starts to cost more to > update timecounters every tick, and the question naturally arises: > what is the target resolution for get*time() functions ? > > Would anybody get in trouble if the precision never got better > than 10msec, even for higher HZ ? > > If so, would 1msec be an acceptable limit ? SPARC had a 4uS resolution in ~1990; it did this by having a hardware clock of very high resolution, and a low update frequency, from which a delta was maintained in software, rather than by having an update requirement for a full timecounter like structure. I used this for a 100uS select(2) timeout for pacing in a game, at one point in time. It's probably worth considering Sun's SunOS 4.1.3 approach for FreeBSD. -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message