Re: C is too old? opinions?
- From: "Ed Prochak" <edprochak@xxxxxxxxx>
- Date: 16 Jul 2006 05:56:54 -0700
Logan Shaw wrote:
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
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.
Ed
.
- Follow-Ups:
- Re: C is too old? opinions?
- From: Logan Shaw
- Re: C is too old? opinions?
- References:
- Re: C is too old? opinions?
- From: Rob Thorpe
- Re: C is too old? opinions?
- From: goose
- Re: C is too old? opinions?
- From: Phlip
- Re: C is too old? opinions?
- From: Logan Shaw
- Re: C is too old? opinions?
- Prev by Date: Power zDVD 7 with ultra ISO keygens
- Next by Date: Re: C is too old? opinions?
- Previous by thread: Re: C is too old? opinions?
- Next by thread: Re: C is too old? opinions?
- Index(es):
Relevant Pages
|