Andrea Arcangeli wrote:
> > > So I thougt the defined HZ has to be changed as a 1000 (as you know,
> > > 100 is a default).
> >
> > If you change the value of HZ, bad things may happen.
>
> If bad things will happen you' ll found a bug in the kernel.
That depends upon what you change it to, I guess. I wouldn't expect to
be able to set HZ to 1E9 and still have a functioning system.
> Sure a too high value could stall the machine (bad thing ;-) and a too low
> one could decrease too much the scheduling frequency causing some strange
> (not bad) things.
Would this include flip buffers overflowing? (I thought that was
sync'd to HZ).
> > > to implement a exact delay time.
> >
> > You can't implement an exact delay time. You'll have to live with
> > whatever delay you get, or switch to using a real-time OS.
>
> Or use udelay() or use the rdtsc to measure how much cycles are passed.
>
> Something like:
>
> timeout = rdtsc() + 2000cycles;
> while (rdtsc() < timout);
>
> This would delay exactly 2000 cycles. This way you can get the precision
> of the frequency of the CPU.
Yeah, but the poster wanted to delay for 125ms. Doing this (regularly)
using a busy wait sounds like it would starve user-space processes of
CPU time (or am I overlooking something?)
--
Glynn Clements <[EMAIL PROTECTED]>