Guile Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: gc notes available
hjstein@bfr.co.il (Harvey J. Stein) writes:
> > > 4. I wrote a tetris game for STk. It has a non generational
> > > conservative GC. The pauses are unnoticable because I increased
> > > the heap allocation at the beginning & call gc at times when it
> > > won't be noticable to the user.
> >
> > Well, what can I say. I have a GUI for my simulator written in Guile
> > and it doesn't feel nice to interact with due to the irregular short
> > pauses. But then I didn't change heap allocation or call gc.
>
> How are you doing the GUI? Using the guile interface to GTk?
I use gtcltk. This means that there is a lot of scheme code executed,
which makes it a good test case.
> Is it basically an animation sort of issue - you want things to move
> smoothly around the screen & gc interrupts it?
No, not in that case. It's a toolbar and a canvas where you can place
objects and connect them to eachother (MacDraw:ish).
> It relieves the user from memory management,
This is what I meant.
> How can a few (gc) calls in the code have a bad influence on program
> structure? I think that's overblown.
It all depends on where you need to do them in order to avoid the
all-generation scans, doesn't it?
If you write a tetris game, placing the gc call directly after
generation of a new piece doesn't destroy code structure.
But where, for example, should you put the gc call in a GUI where the
flow of control is guided by the user's actions? Should I then put it
at the top of every call-back? No, that would be too heavy since
certain types of callbacks are invoked too often (like when dragging
an object in the canvas). It's probably only certain call-backs which
need it, and then, maybe some of them need it conditionally upon what
the user does... etc etc.
> > I haven't claimed that waiting for GC is a big deal in general. I
> > claim that it is a big deal when you're writing GUI code in Scheme.
>
> I'd contend it's not GUI code, but animation.
It seems like both Russ and I have GUI:s which don't do animations but
which still have noticeable, irregular GC pauses.
> > Agreed. I want a behaviour "smooth" enough not to have to worry about
> > GC when writing GUI:s.
>
> The only way you'll get this is with a gc running in a separate thread.
No. You can also get it in at least two more cases: 1. collecting
cells incrementally, either cell by cell, or in small groups.,
2. doing gengc but not collecting all heap blocks during one gc pause.
/mdj
Guile Home |
Main Index |
Thread Index