[mercury-users] Native garbage collector for Mercury

Fergus Henderson fjh at cs.mu.OZ.AU
Thu Sep 10 22:03:14 AEST 1998


On 10-Sep-1998, Thomas Charles CONWAY <conway at cs.mu.OZ.AU> wrote:
> Randall Helzerman, you write:
> > Quick question:  Will the mercury's planned native garbage collector
> > support hard real time operation?
> 
> In a word: no.
> BUT [...]

But most of the hard work in implementing the native garbage collector
is related to getting the compiler to generate appropriate information
so that the run-time system can properly identify the root set.
The actual garbage collection algorithm itself is the easy part ;-)
So once we have got it working, it should not be too hard to plug
in a variety of different garbage collection algorithms.  (However,
most of the real time GC algorithms tend to rely on read barriers
or write barriers; I suppose implementing those may be a bit more work.)

On the other hand, the Boehm collector which we currently use has a mode
in which it supports incremental collection.  All you need to do to
enable this mode is to insert a call to GC_enable_incremental() at
the start of your program.  I suppose this is more soft real time
rather than hard real time.

An alternative for hard real time programs is to avoid GC entirely, and use
backtracking at strategic points in the program to recover memory.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- the last words of T. S. Garp.



More information about the users mailing list