lua-users home
lua-l archive

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


No. The garbage collector is shared across the Lua universe.

You can, however, create multiple Lua universes and run them from separate
threads. This is generally much more efficient than the LuaThreads approach
but does require building a gateway to communicate information across
universes.

Mark

on 3/14/05 9:45 AM, Tim McDaniel at tim@medusalabs.com wrote:

> I understand that the child lua_States created with lua_newthread share their
> global table with the parent lua_State.  It is also
> apparent that Lua has no inherent synchronization.  I am aware of LuaThread,
> but let's ignore that for now... :)
> 
> So, my question is...
> If I have a parent lua_State loaded with all my script, can I create child
> lua_States and safely call them from multiple threads, as
> long as they do not modify the global table?
> 
> Thanks,
> Tim
> 
>