[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: RE: Incremental garbage collection coming to Lua soon?
- From: "Nick Trout" <nick@...>
- Date: Wed, 6 Aug 2003 12:59:59 -0700
> From: Adam D. Moss [mailto:email@example.com]
> Sent: Wednesday, August 06, 2003 12:27 PM
> To: Lua list
> Subject: Re: Incremental garbage collection coming to Lua soon?
> > It would be nice to be able to specify an
> > amount of time that you could delegate to Lua for collection. Or,
> > perhaps some sort of volatile flag could be checked by Lua whilst
> > so that you could interrupt it at will - e.g. on a timer or when you
> > exit an idle period - mmm which suggests multiple threads. Or,
> > there could be a call back to the client application periodically to
> > check whether GC should wind up.
> Or the other way around, which wouldn't suggest threads; have
> the client application call lua_bite_size_gc() repeatedly until
> some time threshold is passed or something important comes up
> in the app. That would need a 'very incremental' gc though. :)
Right. I guess I'm thinking in terms of the current implementation,
which isn't much help. For an incremental collector you're going to have
to store a state which you can return to. So something like
incremental_collection(lua_State*, unsigned int num_cycles) would
suffice and then a time conscious client application can time this and
manage it's load appropriately.