lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]



> From: Adam D. Moss [mailto:adam@gimp.org]
> 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
GC'ing
> > 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,
perhaps
> > 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.

--nick