Hi,
After I create a lua thread in C how do I some point destroy it or have it garbage collected? I see that lua_close does not work on threads.
Another question is that if I want to have multiple threads in 1 lua state with each thread running in its own environment. I suppose I have to store all the environment tables in the state's global variable so that it does not get garbage collected? If that is the case and if the environment table has a metatable with __index=_G so the thread can access the main state's global space then the thread would be able to modify their own environments. How can I keep the environment tables isolated from those threads and still allow access to the Global variables?