lua-users home
lua-l archive

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


On Mon, 24 Sep 2001, Joshua Jensen wrote:

> [...]  I've seen a few
> "random" crashes in my app since I increased the garbage collection
> frequency, where one thread is running Lua instructions and making
> callbacks to C while the other thread is garbage collecting.
>
> I saw these random crashes more often when I didn't have
> luaC_collectgarbage() wrapped in a lua_lock() and lua_unlock().  I
> haven't noticed any adverse effects by wrapping the garbage collection,
> but the crashes still happen on occasion.

I assumed that whenever a thread runs luaC_collectgarbage it must have
the lock already. Isn't that true?


> Ideas?  Anyone?

Do you have GC tag methods? Lua releases the lock to call them. Maybe
there is something wrong with that?

-- Roberto