Re: [linux-audio-dev] gettimeofday() realtime safe?

From: David Olofson <david@email-addr-hidden>
Date: Thu Apr 21 2005 - 12:28:33 EEST

On Thursday 21 April 2005 07.45, Jack O'Quin wrote:
[...]
> > Is calling gettimeofday this many times in the realtime thread a
> > wise idea?
>
> How often? Once per MIDI event? That should be OK, I suppose.

I did a quick hack for testing some custom hardware on an embedded
system, where I just polled gettimeofday() to get some code to run at
10 kHz. (Didn't care about the occasional stalls - which were very
few anyway, as this was the only process actually doing anything at
the time.) That is, a bunch of gettimeofday() calls for each loop,
times 10 kHz. Worked just fine.

This was on a 300 MHz low power Pentium clone, which has about 10-15%
of the power of a 1 GHz P-III CPU. I'm not even sure if Linux is
using RDTSC for gettimeofday() on this thing...

//David Olofson - Programmer, Composer, Open Source Advocate

.- Audiality -----------------------------------------------.
| Free/Open Source audio engine for games and multimedia. |
| MIDI, modular synthesis, real time effects, scripting,... |
`-----------------------------------> http://audiality.org -'
   --- http://olofson.net --- http://www.reologica.se ---
Received on Thu Apr 21 16:15:05 2005

This archive was generated by hypermail 2.1.8 : Thu Apr 21 2005 - 16:15:05 EEST