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

Robin Gareus robin at gareus.org
Mon Jul 11 22:27:54 UTC 2011


On 07/12/2011 12:12 AM, Arnold Krille wrote:
> On Monday 11 July 2011 23:15:26 Tim E. Real wrote:
>> On July 11, 2011 04:50:06 pm Chris Cannam wrote:
>>> I know taking locks in a RT process is deeply frowned upon
>>
>> Likely been answered before, but good time for me to ask:
>> What is the reason it is not recommended?
>> Is it simply because of a long time involved in acquiring the lock, or is
>> it because the lock might block some other Jack thread from running?
>> The same reason why other things like 'malloc' or 'new' are not
>>  recommended either?
> 
> Real-time means "as fast as possible".

No, "real-time" means - _guaranteed_ to be done before time X.
AKA. guaranteed response time.

real-time (tasks|kernels) are often slower on average than non-RT
(tasks|kernels).
As for the linux-kernel: This is due to the overhead introduced by
real-time scheduling (take care of process priority)

While non-real-time (tasks|kernels) may be faster on average; they may
also occasionally take more time than they should. For RT-tasks this is
not acceptable.

e.g.

non-RT task 5 runs: 10 sec, 11 sec, 9 sec,*20sec*,  9 sec (avg 11.8)
    RT task 5 runs: 12 sec, 12 sec, 11sec, 12sec,  13 sec (avg 12.0)

I hope that explains it well for you.
Cheers!
robin



More information about the Linux-audio-dev mailing list