lua-users home
lua-l archive

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


On Wed, 13 Apr 2005, Bernd Kronmueller wrote:

> I thought of starting one Lua up in the main thread and set up global
> variables in that environment. I just can't see how I can access the
> global variables of one lua environment from another lua environment on
> the scripting level (hopefully without going through the registry).

You could write some accessors/setters for the "global"
environment in C and then bind them to lua so that the code can
be called by the different threads when they're running in lua
mode. Just make sure the C code is re-entrant and that you
synchronize access to the meta global environment.

> Is that possible at all or am I just not seeing the obvious??

It's very possible but lua in itself, as far as I can tell, does
not facilitate this transparently in anyway. You need to do it
yourself.

-- 
Thamer Al-Harbash
GPG Key fingerprint: D7F3 1E3B F329 8DD5 FAE3  03B1 A663 E359 D686 AA1F