Re: C is too old? opinions?



Ed Prochak wrote:
Logan Shaw wrote:
Phlip wrote:

Making a garbage collector deterministic would defeat the point of a
garbage collector - trading programming time for run time.

I think what is meant is making the running time of the garbage collector
deterministic. If you could ensure that a garbage collection system
would increase the running time of any arbitrary section of code by no
more than a constant (and known) factor, then you retain the ability
to predict the running time of your code either through theory or through
testing. You could, for example, use every other clock cycle for
garbage collection (to make a gross oversimplification of what the
algorithm would really be like).

Assuming the alternate clock cycle (or a second CPU), the garbage
collector algorithm then would have to deal with pointers changing
while it is running. That makes the process more complex.

A deterministic garbage collector has to be very carefully written. I
haven't seen algorithms for this, but there are a lot of factors to
consider. I'd have to pull out some old text books to see what approach
would work, but merely allocating arbitrary CPU cycles is not going to
solve the problem of making a deterministic GC.

Well, and just to be clear, I wasn't trying to say it was. I was just
saying that if garbage collection overhead can be reduced to a fixed
factor times regular execution time, then that makes real-time
programming with garbage collection basically no more difficult than
without it. The hypothetical garbage collector that runs in every
other clock cycle (or every other instruction, maybe) was just an
illustration to show how easy it would be to work with such a garbage
collector if it did (or could) exist.

Anyway, the point was to illustrate what one possible deterministic
running time for a garbage collector might look like. It may well
be that such a garbage collector is theoretically impossible for all
I know.

- Logan
.



Relevant Pages

  • Re: C is too old? opinions?
    ... garbage collector - trading programming time for run time. ... to predict the running time of your code either through theory or through ... A deterministic garbage collector has to be very carefully written. ... but merely allocating arbitrary CPU cycles is not going to ...
    (comp.programming)
  • Re: C is too old? opinions?
    ... I think what is meant is making the running time of the garbage collector ... algorithm would really be like). ... Assuming the alternate clock cycle, ... but merely allocating arbitrary CPU cycles is not going to ...
    (comp.programming)
  • Re: Advanced data structures
    ... garbage collector the ... needlessly thrashes memory is not visible in the code you write. ... If we can count the allocation calls, we know how much the algorithm ...
    (comp.lang.c)
  • Re: Destroying an Object
    ... Does ruby's garbage collector really work, or it's as lame as .NET ... The newest .NET GC uses an algorithm ... Ruby's GC is much less buggy ...
    (comp.lang.ruby)