lua-users home
lua-l archive

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

> > * It has the ability to be multithreaded.  This is critical to 
> > background loading processes in Amped.  There is also some trickery 
> > used with the shared global states that showed up in 4.1 Alpha.
> I don't think I've seen this "trickery used with the shared 
> global states" before. Does this mean that multiple 
> lua_State's can each have their own private globals as well 
> as share some globals? Can someone point me to a link in the 
> archives if this has been discussed before?

I'm sorry.  I meant to say _I_ use some trickery with the global states,
but it is done in a very, very careful fashion, and certainly shouldn't
be done at all (although it was fun!).  Basically, I modified the Lua
code (just for fun) to allow registration of more than one global state
in a global state.  I did it to test isolation of static Lua data from
the main garbage collector.  It appears to work, but it is very
dangerous.  There definitely has got to be a better way.