Re: C is too old? opinions?



Phlip wrote:
goose wrote:

Now I'm really curious; how does the garbage collector run in
deterministic time? Is it possibly a case of running the gc after every X
operations knowing that no more than Y memory has to be released and that
doing that will require no more than Z time?

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

If the programmer must specify "please collect this and this object, now,
before the next real-time strobe", they might as well use pointers and
'free()'...

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). It would be just like running on a
processor at half the clock speed (or some other factor): it's slower,
but it's still capable of real-time guarantees.

- Logan
.