lua-users home
lua-l archive

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


I have never had this problem. Newly created threads are set up to use the global table of the creator thread. Threads are subject to same garbage collection rules as any other object (table, closure, string, etc). I would suggest for you to try to emulate your C side in Lua in attempt to achieve the same behavior. Then you could post this script here for further examination. Another thing you can do is to produce minimal case in C that leads to the behavior you are referring to and post it here. From what you have described the behavior may be correct (even though you don't like it) or not (depending on your exact usage pattern). Perhaps, you could set up some artificial test cases and see if you can reproduce the behavior on them. In general, an object in Lua is GCed when there are no direct or indirect strong references to it. If you can set up a test case that proves this to be wrong than it's a Lua bug, it's a bug on your side otherwise.

Nothing else comes to mind at the moment,
AB

-----Original Message-----
From: Antero Vipunen [mailto:antero@ngs.ru]
Sent: Wednesday, October 29, 2003 1:41 AM
To: Lua List
Subject: Repeating my question

Hello All,

I have a strange problem with GC.
I assigned __gc metamaethod for my objects to trace gcollection
and discovered that when i create luathreads using lua_newthread, run
some scripts in them and then call lua_setgctreshold(0), all my
objects become gc'ed except created in thread, that was created last.

Is it a bug or special feature?

--
Best regards,
  Antero Vipunen