Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 03 Jan 2002 10:28:57 +0100
From:      Poul-Henning Kamp <phk@critter.freebsd.dk>
To:        Bruce Evans <bde@zeta.org.au>
Cc:        Mike Silbersack <silby@silby.com>, freebsd-arch@FreeBSD.ORG
Subject:   Re: DELAY accuracy Re: cvs commit: src/sys/dev/usb uhci.c 
Message-ID:  <831.1010050137@critter.freebsd.dk>
In-Reply-To: Your message of "Thu, 03 Jan 2002 20:07:52 %2B1100." <20020103194429.T15755-100000@gamplex.bde.org> 

next in thread | previous in thread | raw e-mail | index | archive | help
In message <20020103194429.T15755-100000@gamplex.bde.org>, Bruce Evans writes:

>Code should be written to not depend on
>DELAY() being very accurate.  OTOH, the i386 DELAY() could be written
>better using microuptime(undoc).  It would then be much simpler (except
>possibly for complications to make it work at boot time), and more
>accurate (except for small intervals on slow machines).

I have actually thought about DELAY() a fair bit.

I agree that code shouldn't depend too much on the accuracy of DELAY()
but on the other hand I think we can do much better than we do today.

Obviously, nanosleep() will need a MD part for short delays, but long
delays can be handled MI in timecounter land, since the timecounters
have already hold of the hardware.

On the other hand, nanosleep() would mostly be for very short intervals,
and the changes that for instance the TSC might experience are minor
compared to the interval.

Summary:
	a) A lot more can be done to improve things.
	b) Not doing so properly discourages people from using it.

-- 
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.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?831.1010050137>