hi res timer

=_NextPart_000_0006_01C61D9F.272A7FA0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable


In linux 2.6 kernel the clock_getRes says that it is 1ms accuracy. =20

I basically want to have a method run every 1 ms. However when I run it = on linux 2.6 kernel fedora core 2 i don't get that and I get a lot of = jitter.

We have tried running it as root and used top to renice it to a high = level.

What are we doing wrong? =20 Can someone point me to an example chuck of code that shows a hi-res = timer at over 100 hz.

thanks in advance

Reply to
Loading thread data ...

Linux is not a hard realtime system, so you will find a jitter of _any_ size if you wait long enough and produce enough stress in the system.

If you want reliable timing you need to add something like RTAI.


Reply to
Michael Schnell

Which 2.6 kernel, there are several of them :) Is it saying "accuracy" or is it saying "precision?"

What do you get and what is your definition of "a lot" of jitter? What would be acceptable jitter for your situation?

I seem to recall that there can be three values for HZ now in a

2.6.mumble kernel (maybe that cam in .14?) 100, 250 and 1000 I wonder if running HZ at 1000 and perhaps playing with timeslices and such might get things going "well enough" without having to go all the way to what I think is RTAI?

rick jones

firebug n, the idiot who tosses a lit cigarette out his car window
these opinions are mine, all mine; HP might not want them anyway... :)
 Click to see the full signature
Reply to
Rick Jones

I was playing with .14 recently and saw it there. I'm not sure if it came any earlier, though.

echo izn@pwlvkqrw.nwv|tr zwvq aeto
Reply to
Ian Kilgore

If you don't mind that _sometimes_ the timing condition is not met, you are fine (2.6 is said to be a better _soft_realtime_ system than previous versions). But there is no guarantee.


Reply to
Michael Schnell

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.