[Adrian Knoth]
>Iain Duncan wrote:
This, I'm afraid, is an idea with a fair share of issues. It does not
seem a trivial problem to estimate the total memory needs of a
reasonably complex application. And even if you can solve this, you
will find that common malloc implementations (such as the one in
glibc) protect the heap with mutexes. Regardless of memory
availability, your real-time thread can always stall in malloc() or
free() when a heap mutex is found locked by another thread.
As for the original question, I'd suggest handling the maintenance and
memory management of large lists of events in low-priority,
low-frequency threads. These threads periodically feed the realtime
thread bursts of a small number of events, ahead of time and using
preallocated FIFO queues which can be of reasonably modest size. (In
fact, I seem to remember that this approach has been discussed on this
list recently, if perhaps briefly.)
Cheers, Tim
_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev
LINUX® is a registered trademark of Linus Torvalds in the USA and other countries.
Linuxaudio.org logo copyright Thorsten Wilms © 2006.
Hosting provided by the Virginia Tech Department of Music and DISIS.