[coyotos-dev] coyotos.sleep, sleepTill, the epoch
Jonathan S. Shapiro
shap at eros-os.com
Mon Feb 12 09:24:27 CST 2007
On Mon, 2007-02-12 at 08:13 -0700, Nigel Williams wrote:
> > On Mon, 12 Feb 2007 01:05:27 +0000, Sam Mason wrote:
> > On Mon, Feb 12, 2007 at 12:15:46AM +0100, Valerio Bellizzomi wrote:
> > >> The hardware clock on a PC uses a low cost time base oscillator. It is
> > >> imprecise in any case.
> >
> > >I think the main reason it was done under Linux was for scheduler
> > >improvements rather than increased timer/clock accuracy.
>
> Am I right in thinking that recent scheduler designs are now using the
> cycle count register on newer processors to track how long a process
> or thread executes?
The answer is very hardware specific.
On PCs, if you mean TSC, the answer is "no". The problem is that the
cycle count counts cycles, and the hardware clock rate is adjustable to
control power consumption -- if you have any recent PC you can put an
applet on your desktop and you can readily see the clock going up and
down.
On PC's, the IOAPIC is *supposed* to implement a tick counter that
provides a stable rate regardless of external frequency scaling. On some
hardware it actually *is* stable, but some IOAPIC implementations are
known to have gotten this wrong.
I haven't looked in to the current status of all of this in some time.
One might hope (probably in vain) that more recent processors have
cleaned this up. I suspect we will need to look very shortly.
--
Jonathan S. Shapiro, Ph.D.
Managing Director
The EROS Group, LLC
+1 443 927 1719 x5100
More information about the coyotos-dev
mailing list