Re: [linux-audio-dev] malloc() in RT code considered not-so-harmful?

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: Re: [linux-audio-dev] malloc() in RT code considered not-so-harmful?
From: Steve Harris (S.W.Harris_AT_ecs.soton.ac.uk)
Date: Tue Jul 13 2004 - 23:50:04 EEST


On Tue, Jul 13, 2004 at 10:21:23 -0700, Joshua Haberman wrote:
> >Its not my experieince that you usually need to allocate memory in RT
> >threads, the times when I've seen it done are mostly <generalisation>
> >bacuase of bad design, excessive OO-ness or lack of knowledge of
> >alloca(3) </generalisation>.
>
> One reason I can think of is that you want to be sure to never, ever
> drop a captured buffer when you are recording. You need buffers to send
> the captured audio data to a disk thread, but without being able to call
> malloc() from the audio thread, you have to pre-allocate a fixed amount
> of memory for this purpose. No guess is high enough to guarantee that
> you will never drop buffers, and the more you allocate in advance the
> higher your overhead.

Thats true, but that problem (running out of disk buffer) only happens in
extreme conditions, soft RT systems fail under lots of extreme conditions
awyway.

- Steve


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : Wed Jul 14 2004 - 00:25:40 EEST