From owner-freebsd-arch Thu Dec 2 15:14:28 1999 Delivered-To: freebsd-arch@freebsd.org Received: from ns1.yes.no (ns1.yes.no [195.204.136.10]) by hub.freebsd.org (Postfix) with ESMTP id 84B4C14D30 for ; Thu, 2 Dec 1999 15:14:22 -0800 (PST) (envelope-from eivind@bitbox.follo.net) Received: from bitbox.follo.net (bitbox.follo.net [195.204.143.218]) by ns1.yes.no (8.9.3/8.9.3) with ESMTP id AAA21406 for ; Fri, 3 Dec 1999 00:13:17 +0100 (CET) Received: (from eivind@localhost) by bitbox.follo.net (8.8.8/8.8.6) id AAA86053 for freebsd-arch@freebsd.org; Fri, 3 Dec 1999 00:13:17 +0100 (MET) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.40.131]) by hub.freebsd.org (Postfix) with ESMTP id 51D1414C7F for ; Thu, 2 Dec 1999 15:12:46 -0800 (PST) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.9.3/8.9.2) with ESMTP id AAA01593; Fri, 3 Dec 1999 00:11:52 +0100 (CET) (envelope-from phk@critter.freebsd.dk) To: peter.jeremy@alcatel.com.au Cc: arch@freebsd.org Subject: Re: Threads stuff In-reply-to: Your message of "Fri, 03 Dec 1999 10:03:34 +1100." <99Dec3.095608est.40342@border.alcanet.com.au> Date: Fri, 03 Dec 1999 00:11:52 +0100 Message-ID: <1591.944176312@critter.freebsd.dk> From: Poul-Henning Kamp Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In message <99Dec3.095608est.40342@border.alcanet.com.au>, Peter Jeremy writes: >On 1999-Dec-03 07:22:54 +1100, Poul-Henning Kamp wrote: >>In message <99Dec3.070619est.40333@border.alcanet.com.au>, Peter Jeremy writes: >>>On my PII-266, clock_gettime(CLOCK_REALTIME) takes 2.48usec and >>>gettimeofday() takes 2.42usec - slightly better. > >>The time it takes depends on the "timecounter" you are using for >>your timekeeping. I will venture to guess that the above numbers >>come from a UP machine using the TSC. > >Ooops, I forgot about that. Yes, this is an UP system using the TSC. >AFAIK, I can't swap to the 8254 w/o rebooting. > >I tried the same thing on a P-133 using the i8254 and got: >clock_gettime(CLOCK_REALTIME) 6.92 usec >gettimeofday() 5.93 usec > >(And on a 386SX25 running 2.2.5, I got 115usec). > >>If the timestamps don't need to be more precise than 1/hz, > >I suspect that for the purposes in question, it _does_ need to >be SMP safe (which writes off the TSC) and will need better than >1/hz precision (though I'm not definite about this). It would be possible to make it optional, so that the routine would try to use the "all-in-userland" timekeeping only if available and resort to the kernel if not. -- Poul-Henning Kamp FreeBSD coreteam member phk@FreeBSD.ORG "Real hackers run -current on their laptop." FreeBSD -- It will take a long time before progress goes too far! To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message