Newsgroups: comp.lang.smalltalk,comp.object,comp.lang.c++,comp.lang.java
Path: cantaloupe.srv.cs.cmu.edu!bb3.andrew.cmu.edu!newsfeed.pitt.edu!gatech!swrinde!howland.reston.ans.net!psinntp!psinntp!psinntp!psinntp!mercury.hsi.com!news
From: marksc@wpmail.code3.com (Mark A. Scarton)
Subject: Re: The Good, the Bad, the Ugly, and the Wicked ...
Message-ID: <316e7e85.177818679@mercury.hsi.com>
Sender: news@hsi.com (USENET news)
Nntp-Posting-Host: pc027064.code3.com
Reply-To: marksc@wpmail.code3.com
Organization: 3M Health Information Systems
X-Newsreader: Forte Agent .99d/32.182
References: <31570B8E.5A12@vmark.com> <4je5rq$7qg@mimas.brunel.ac.uk> <4jes0t$gth@decaxp.HARVARD.EDU> <31630E30.5A02@oma.com> <4kbq3q$1i8@gaia.ns.utk.edu> <RMARTIN.96Apr9160010@rcm.oma.com>
Date: Fri, 12 Apr 1996 16:08:20 GMT
Lines: 30
Xref: glinda.oz.cs.cmu.edu comp.lang.smalltalk:37188 comp.object:47492 comp.lang.c++:184307 comp.lang.java:39679

>   : Malloc and new can *always* be made to be deterministic.  That is
>   : one of the major attractions to manual memory management in 
>   : real time systems.  You can use malloc/free (new/delete) pairs which are
>   : 100% predictable.
>
>   Are they?  Have you gone through the all the possible orderings of
>   previous 'new' and 'malloc' so that you ***KNOW*** exactly
>   what the internal heap structures are so that subsequent calls to 
>   'malloc' and 'new' and 'free' take a known amount of time?
>
>Yes.  Simply because it is possible to create memory allocators that
>don't use heaps.  Rather they use completely deterministic lists of
>preallocated blocks.  The time for 'new' and the time for 'delete' are
>absolutely constant.  The exact same number of instructions execute no
>matter what order new and delete are called in.

I must concur.  I built a passive sensor system (radar) using OS/2 for
management, flow control, and display preparation and an adapter with i860 chips
for the object tracker.  I used (feed forward) queues of preallocated memory
blocks to hold incoming signals within frames, where the queue management was
preallocated slots for pointers into the block buffers.  The queue memory was
then shared among the processors...successfully even.  ;-)  This resulted in a
determinstic, highly optimized memory manager.  Plus real-time tracking of
aircraft and short range ballistic missiles on a 486/50 class PC.  The previous
edition using malloc had failed.

Mark A. Scarton, ABD
CompUtah!, Park City, Utah USA
Home: 801.565.9835
Office: 801.265-4612
