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

From: Dave Robillard <drobilla@email-addr-hidden>
Date: Thu Apr 21 2005 - 22:11:27 EEST

Hi all,

I need to know if gettimeofday (or one of the other standard time
functions) is okay to use in a realtime jack thread. I can't find any
information on the net about whether it's deterministic or not (or even
how expensive it is).

Problem is I have an event-based system that pushes events (from
OSC/Midi) into a dequeue, which the audio thread runs through to
execute. If you flood with events, too many need to be processed per
block, the audio thread takes too long and you get dropouts.

I'd like to be able to only process (non timestamped) events for x% of
the time available to prevent this from happening; so I need to be able
to determine how much time has been eaten by event processing so far.

Is calling gettimeofday this many times in the realtime thread a wise
idea?

Cheers,

-DR-
Received on Thu Apr 21 12:15:05 2005

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