[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: the gc
- From: "D Burgess" <dburgess@...>
- Date: Mon, 7 Aug 2006 23:32:56 +1000
Well I am almost sure that it is not my bug and
the gc definitely collects stuff that is on a thread stack
(and sets its value to nil). The question is what do I need do
to provide more info. I am using 5.1.1.
The collect call is
lua_gc(L, LUA_GCCOLLECT, 0);
where L is the main (universe) state.
I have two other threads each with 4 items on the stack. One of
these items is the thread environment. The above collect sets
the value of the item at stack position 3 to nil when the GC
I have a 1:1 relationship between OS threads and Lua threads
and only one of the OS threads executes at a time.
I am using lua_resume(), all things start from C.
It appears that a garabge collect in thread A is causing the contents
of the thread stack in thread B to be collected.
This only happens under great stress ( a test program that creates
a million tables being executed in two different threads).
I have tables and userdata that only exist on the thread stack these
are the ones that get collected.