lua-users home
lua-l archive

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


> [...]
> 
> My current plan is to see if the finalizer code in Lua can somehow be 
> simplified. It seems like Lua spends a lot of effort making sure that 
> finalizers are called in the right order and at the end of the garbage 
> collection cycle. I don't actually need that. My finalizers can be 
> called in any order and at any time during garbage collection, before 
> the userdata object is freed.
> 
> I'm thinking (hoping) that with these less strict requirements it would 
> be possible to get rid of the stall in atomic() by rewriting the way the 
> garbage collector handles unit data, but I'm a bit wary of touching the 
> lua GC code.

I am not sure this will help. I guess that what causes the stall is
not that the handling of each userdata is complex, but that all those
10,000 userdata must be handled atomically. (The key function here
is 'luaC_separateudata'.) I think the solution would be to do that
separation phase incrementally too, but I don't know how to do it.

-- Roberto