[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: How to stop yielded threads from being garbage collected
- From: Martin Linklater <mslinklater@...>
- Date: Thu, 24 Nov 2011 10:05:13 +0000
Thanks for that Peter - it now breaks instantly 8).
On 24 Nov 2011, at 09:57, Peter Pimley wrote:
> 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.
>