comp.lang.ada
 help / color / mirror / Atom feed
From: Hans-Juergen Boehm <boehm@mti.sgi.com>
Cc: boehm
Subject: Re: Garbage Collection in Ada
Date: 1996/10/17
Date: 1996-10-17T00:00:00+00:00	[thread overview]
Message-ID: <32666C4A.41C6@mti.sgi.com> (raw)
In-Reply-To: DzFA2u.Aw@world.std.com


Robert A Duff wrote:
> 
> In article <3265BD97.41C6@mti.sgi.com>,
> Hans-Juergen Boehm  <boehm@mti.sgi.com> wrote:
> >For systems I've seen it does inhibit some optimizations, ar least to
> >the extent that proper use of a conservative collector inhibits
> >optimizations.  Especially in multithreaded systems, there must be a
> >recognizable pointer to every accessible object at every program point
> >at which a GC might occur.  Often this is between every pair of
> >instructions.  In a nonconservative system you could generate
> >arbitrarily complex tables to allow reconstruction of those pointers.
> 
> I would think it would be simpler and more efficient to represent this
> information as executable code.  That is, the compiler generates a
> procedure for each type, and for each stack frame, that knows how to
> find all the pointers.  It could take the PC as a parameter, so it could
> deal with optimizations where, for example, register R1 contains a
> pointer sometimes, and an integer other times.
> 
That seems to be the consensus.  Whether or not it's right probably
depends on the context.  There appear to be systems around that lose performance
by generating code instead of tables.  There are at least 2 reasons it may be
undesirable:

1. Code size.  Even generating traversal procedures for user-defined data
structures is not free.  (The SRC Modula 3 implementation does this, so it
should even be possible to quantify the effect.)  Things get much worse if
you have to generate a traversal procedure for every client procedure frame,
and if the result of that procedure depends on the PC value.  Even table sizes
for code with limited GC interruption points are nontrivial (see the paper by
Diwan, Moss, and Hudson in PLDI 92).  I would guess that generating such code
for really arbitrary interruption points with full optimization would more
than double code size.  (Actually this is impossible in a few odd cases.  See the
above paper.)

2. Too much procedure call overhead, especially for structures composed of many
small user-defined types.  How much of an issue this is depends on the details
of the compilation system.  But it's usually easier to optimize tables with
whole program information than code.  Since table interpretation can be
cheap, this may dominate.

> Anyway, I don't understand why you would want a conservative collector,
> unless you're dealing with an uncooperative language/compiler (like C).
> If the language "requires" gc, then there's every opportunity to have a
> well-defined interface between generated code and gc, so why be
> conservative?
> 

There are several reasons to go with a collector that acts conservatively by
default, but can make use of type information:

1. C intercallability.
2. The compiler-collector interface is much simpler, at least for the fall-back case.
You might get code compiled by one compiler to link against code compiled by another.
3. You can scan the top stack frame conservatively.  Then you only need to have
pointer location information at call sites, potentially reducing table (or traversal
code) size substantially.
4. You don'y have to get the type information right for hand-coded routines in the
runtime.  In my experience, this is a significant source of persistent GC bugs.  It
also makes it easier to debug other type descriptor problems.


-- 
Standard disclaimer ...
Hans-Juergen Boehm
boehm@mti.sgi.com




  parent reply	other threads:[~1996-10-17  0:00 UTC|newest]

Thread overview: 126+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-10-13  0:00 Garbage Collection in Ada Jonas Nygren
1996-10-13  0:00 ` Lars Farm
1996-10-13  0:00   ` Robert Dewar
     [not found]     ` <19961014115513529729@dialup105-2-16.swipnet.se>
1996-10-16  0:00       ` Robert Dewar
1996-10-16  0:00         ` Hans-Juergen Boehm
1996-10-16  0:00           ` Robert Dewar
1996-10-16  0:00             ` Hans-Juergen Boehm
1996-10-17  0:00               ` Robert Dewar
1996-10-17  0:00                 ` Hans-Juergen Boehm
1996-10-17  0:00                   ` Robert Dewar
1996-10-16  0:00         ` Lars Farm
1996-10-16  0:00           ` Robert Dewar
1996-10-16  0:00             ` Hans-Juergen Boehm
1996-10-17  0:00               ` Robert Dewar
1996-10-17  0:00                 ` Hans-Juergen Boehm
1996-10-17  0:00               ` Robert A Duff
1996-10-17  0:00                 ` Larry Kilgallen
1996-10-17  0:00                 ` Hans-Juergen Boehm [this message]
1996-10-17  0:00             ` Lars Farm
1996-10-23  0:00               ` Robert Dewar
1996-10-13  0:00   ` Larry Kilgallen
1996-10-14  0:00   ` John Howard
1996-10-15  0:00     ` Lars Farm
1996-10-15  0:00       ` Robert Dewar
1996-10-15  0:00         ` Lars Farm
1996-10-15  0:00         ` Hans-Juergen Boehm
1996-10-17  0:00         ` Thomas Kendelbacher
1996-10-17  0:00           ` Robert Dewar
1996-10-23  0:00         ` Richard A. O'Keefe
1996-10-23  0:00           ` Larry Kilgallen
1996-10-15  0:00       ` Robert A Duff
1996-10-14  0:00   ` Robert A Duff
1996-10-14  0:00     ` Lars Farm
1996-10-15  0:00       ` Robert A Duff
1996-10-16  0:00         ` Lars Farm
1996-10-16  0:00           ` Robert Dewar
1996-10-17  0:00             ` Robert A Duff
1996-10-19  0:00               ` Robert Dewar
1996-10-19  0:00                 ` Lars Farm
1996-10-20  0:00                   ` Robert Dewar
1996-10-20  0:00                     ` Robert A Duff
1996-10-20  0:00                       ` Robert Dewar
1996-10-21  0:00                     ` Lars Farm
1996-10-21  0:00                       ` Robert Dewar
1996-10-21  0:00                         ` Lars Farm
1996-10-21  0:00                     ` Geert Bosch
1996-10-21  0:00                       ` Hans-Juergen Boehm
1996-10-23  0:00                     ` Fergus Henderson
1996-10-24  0:00                     ` Richard A. O'Keefe
1996-10-20  0:00                 ` Robert A Duff
1996-10-20  0:00                   ` Robert Dewar
1996-10-21  0:00                     ` Hans-Juergen Boehm
1996-10-21  0:00                       ` Robert Dewar
1996-10-19  0:00               ` Richard Kenner
1996-10-15  0:00     ` Hans-Juergen Boehm
1996-10-15  0:00   ` Keith Thompson
1996-10-13  0:00 ` Robert Dewar
1996-10-14  0:00 ` Jon S Anthony
1996-10-15  0:00   ` Robert Dewar
1996-10-15  0:00 ` Hannes Haug
1996-10-15  0:00 ` Robert I. Eachus
1996-10-15  0:00   ` Robert Dewar
1996-10-16  0:00   ` whiting_ms@corning.com (Matt Whiting)
1996-10-16  0:00     ` Robert Dewar
1996-10-17  0:00   ` John Howard
1996-10-17  0:00     ` Robert Dewar
1996-10-18  0:00       ` Lars Farm
1996-10-19  0:00         ` Robert Dewar
1996-10-20  0:00           ` Lars Farm
1996-10-21  0:00             ` Robert Dewar
1996-10-22  0:00               ` Lars Farm
1996-10-21  0:00             ` Nicolay Belofastow
1996-10-21  0:00               ` Robert Dewar
1996-10-20  0:00         ` Robert A Duff
1996-10-20  0:00           ` Robert Dewar
1996-10-22  0:00         ` Mitch Gart
1996-10-23  0:00           ` Fergus Henderson
1996-10-23  0:00           ` Hans-Juergen Boehm
1996-10-27  0:00             ` Richard Riehle
1996-10-29  0:00         ` Jon S Anthony
1996-10-30  0:00         ` James Rogers
1996-10-30  0:00         ` Jon S Anthony
1996-10-30  0:00         ` Brian Rogoff
1996-10-30  0:00         ` Jonas Nygren
1996-10-18  0:00       ` Hans-Juergen Boehm
1996-10-18  0:00       ` Lars Farm
1996-10-20  0:00         ` Robert A Duff
1996-10-16  0:00 ` Jon S Anthony
1996-10-16  0:00 ` Jon S Anthony
1996-10-16  0:00 ` Jon S Anthony
1996-10-16  0:00 ` Jon S Anthony
1996-10-17  0:00   ` Robert Dewar
1996-10-16  0:00 ` Ole-Hjalmar Kristensen FOU.TD/DELAB
1996-10-16  0:00   ` Robert Dewar
1996-10-17  0:00 ` Rick Hudson
1996-10-17  0:00 ` Hans-Juergen Boehm
1996-10-17  0:00 ` Robert I. Eachus
1996-10-17  0:00   ` Robert Dewar
1996-10-17  0:00     ` Richard Kenner
1996-10-18  0:00 ` Jon S Anthony
1996-10-23  0:00   ` Robert Dewar
1996-10-18  0:00 ` Rick Hudson
1996-10-18  0:00 ` Jon S Anthony
1996-10-18  0:00   ` Robert Dewar
1996-10-21  0:00 ` Laurent Pautet
1996-10-21  0:00 ` Jon S Anthony
1996-10-22  0:00 ` Tapani Rundgren
1996-10-22  0:00 ` Jon S Anthony
1996-10-23  0:00 ` Jon S Anthony
1996-10-24  0:00   ` Mitch Gart
1996-10-24  0:00 ` Robert I. Eachus
1996-10-24  0:00 ` Hans-Juergen Boehm
1996-10-25  0:00 ` Jon S Anthony
1996-10-28  0:00 ` Robert I. Eachus
1996-10-29  0:00 ` Hans-Juergen Boehm
  -- strict thread matches above, loose matches on Subject: below --
1996-11-02  0:00 Jon S Anthony
     [not found] <01bbc6a3$4cf03480$829d6482@joy.ericsson.se>
1996-10-31  0:00 ` Mitch Gart
1996-10-31  0:00   ` Jonas Nygren
1996-11-03  0:00   ` Matthew Heaney
1996-11-06  0:00     ` Robert A Duff
1996-11-06  0:00       ` Norman H. Cohen
1996-11-01  0:00 ` Jon S Anthony
1996-11-06  0:00 ` Brian Rogoff
1996-11-07  0:00   ` Tucker Taft
1996-10-22  0:00 Brian Rogoff
1996-10-11  0:00 C++ Standardization (was: Once again, Ada absent from DoD SBIR solicitation) Dave Wood
1996-10-17  0:00 ` Garbage Collection in Ada Thomas Kendelbacher
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox