lua-users home
lua-l archive

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


> -----Original Message-----
> From: lua-l-bounces@lists.lua.org [mailto:lua-l-bounces@lists.lua.org] On
> Behalf Of Joachim Bürmann
> Sent: maandag 7 april 2014 8:36
> To: lua-l@lists.lua.org
> Subject: Sharing a global table between two independent Lua interpreters
> 
> Hello all,
> 
> I'm wondering if it is possible to share a 'global' lua table created in
> C++ between two running Lua interpreter instances.
> 
> Both Lua interpreters are called alternately from C++ and execute the
> same Lua script. A race condition while accessing the global table won't
> happens.
> 
> I know how to create a table in C++ and pass it to the Lua interpreter.
> But I'm unsure if Lua internally just hold it's own copy of the table
> and therefore both interpreters access two different tables.
> What I need is a single table to exchange informations between both
> running interpreters.
> 
> Any hints or suggestions?

Of the shelf solution; use the Lanes library, otherwise maybe this [1] recent thread provides some insights

> 
> Thanks a lot
> 
> Joachim
> 

[1] http://lua-users.org/lists/lua-l/2014-04/msg00208.html