Mail Archives: djgpp/1998/06/19/11:34:39
Javier Calleja wrote:
> Hi world:
>
> I am programming a real time aplication; I need to create some date
> structures that, I think, it fits to dynamic memory allocation algorithms
> (tree structures using 'malloc', 'calloc', 'free', ...).
>
> But, must I use dynamic memory allocation with real time aplications? Is
> the O.S. fast enough in memory assignment and memory release? And, is the
> dynamic memory allocation a robust programming method or may the O.S. crash
> my programm?
>
> Thanks world.
In my work I'm using mixed technique :
At hardware interrupt handlers I use fast fifo-queue.
It allocates at sturtup time. You can increase the initial size of such queue
to recieve more data
without loosing. I recommend you involve some flow control method in your
hardware code, so
you can notify hardware to pause trasmition of data then queue near full and
resume paused transmition
then data proccessed or stored in a safe place.
At the other parst of your code you *safely* can use malloc and company.
PS. you may take a look at my Palantir to see examples of near-realtime kernel.
--
____ ____
| \ / Dim Zegebart
____/____
Moscow Russia
WWW - http://www.geocities.com/siliconvalley/pines/7817
DZcomm - comm library for Allegro
Palantir - multitasking kernel for Allegro (based on PDMLWP)
- Raw text -