delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/06/19/11:34:39

Message-ID: <358A855D.687FF8EE@post.comstar.ru>
Date: Fri, 19 Jun 1998 19:35:57 +0400
From: Dim Zegebart <zager AT post DOT comstar DOT ru>
Reply-To: zager AT post DOT comstar DOT ru
Organization: Comstar Ltd.
MIME-Version: 1.0
To: Javier Calleja <dismuntel AT apdo DOT com>
CC: djgpp AT delorie DOT com
Subject: Re: Dynamic memory allocation in real time aplications
References: <01bd9aac$22753140$0100a8c0 AT dismuntel DOT ctv DOT es>


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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019