[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: How to stop yielded threads from being garbage collected
- From: Peter Pimley <peter.pimley@...>
- Date: Thu, 24 Nov 2011 09:57:55 +0000
If you create the thread and you *don't* keep a reference to it then
the thread will be eligible for garbage collection. Could it be that
the only reason that any of your threads do run is because although
they are eligible for garbage collection, they haven't been collected
*yet*.
This would be easy to check by running a full garbage collection cycle
every frame (I'm guessing it's a game if it's 30Hz, right?). Do this
by calling lua_gc with LUA_GCCOLLECT. See
http://www.lua.org/manual/5.1/manual.html#lua_gc This will slow
things down a bit, so consider removing it again when you have
finished debugging.