[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: RE: Garbage collection thread synchronization
- From: "Josh Jensen" <joshj@...>
- Date: Tue, 25 Sep 2001 09:59:04 -0700
> I assumed that whenever a thread runs luaC_collectgarbage it
> must have the lock already. Isn't that true?
It appears this way, but in my case, wrapping luaC_collectgarbage() in
the lua_lock()/lua_unlock() combo makes most crashes go away.
> > Ideas? Anyone?
>
> Do you have GC tag methods? Lua releases the lock to call
> them. Maybe there is something wrong with that?
I have a nil GC tag method that has a single line in it:
lua_setgcthreshold(state, 1000000);
Basically, I want to control garbage collection times myself. So do you
suppose that it is this garbage collection tag method that might be
letting the other thread in during the garbage collection? It would
make sense, particularly if the other thread is already blocking on the
critical section. If you think this might be it, what ideas would you
have to get around this?
Thanks,
Josh