[clug] Any Timers Faster than 10ms?
simon at sibern.com.au
Wed Nov 26 12:33:38 EST 2003
Carter, Michael wrote:
>I'm trying to write some software for Linux that has some pretty accurate timing requirements. I know that in userspace you can get timers to wake up processes, but this seems to only be with a granularity of about 10ms, which is apparently how often there is a timer interrupt on IRQ0. However, what I'd really like is to be able to perform a task, sleep for a few hundred microseconds, and then perform another task. Are there any more accurate timers available in the kernel? Perhaps a timer exisits in an ordinary i386 architecture that can offer interrupts at a faster rate? Can I use gettimeofday() in anything other than a busy wait?
Hmmm. Last time I did this I had to use real time and I had a special
card for handling interupts. The system was designed for scaning radio
signals looking for any active radio signals that were human listenable
(for army). That type of accuracy ment that I needed jsut 2 processes
running on that server. One built a hash table of frequencies to scan
and the other processed them. No other processes could be run as the
two tasks hoged 50% CPU each. The signal processor was the hardest to
develop and microsecond timing (ie: we had a spectrum analyser attached
to see what was going on and for debugging ) .
Not easy when you need that sort of accuracy.
More information about the linux