Message-ID: <358A855D.687FF8EE@post.comstar.ru> Date: Fri, 19 Jun 1998 19:35:57 +0400 From: Dim Zegebart Reply-To: zager AT post DOT comstar DOT ru Organization: Comstar Ltd. MIME-Version: 1.0 To: Javier Calleja 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> Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 7bit Precedence: bulk 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)