Re: [LAD] a *simple* ring buffer, comments pls?

From: Dan Mills <dmills@email-addr-hidden>
Date: Tue Jul 12 2011 - 01:24:52 EEST

On Tue, 2011-07-12 at 00:12 +0200, Arnold Krille wrote:

>
> Real-time means "as fast as possible".

Err not really.

Real-time means "Has a bounded response time", locks generally put your
completion time at the mercy of another process that is often not
designed to have a bounded response time.

It is probably more correct to say that locks should be used with
extreme caution in RT processes as their use makes the relevant part of
another thread part of the time critical response timing.

Trylock is an interesting case can can actually be used to solve some of
this, have two copies of the working data structure, one protected by a
lock, then in the RT thread call trylock and if it succeeds copy the
data protected by the lock over the data set used by the RT process and
release the lock.

If it fails then you still have a coherent set of data, and it might
succeed the next time, this is useful for UI data sets (in both
directions).

Regards, Dan.

_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@email-addr-hidden
http://lists.linuxaudio.org/listinfo/linux-audio-dev
Received on Tue Jul 12 04:15:03 2011

This archive was generated by hypermail 2.1.8 : Tue Jul 12 2011 - 04:15:03 EEST