[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: RE: Sharing a global table between two independent Lua interpreters
- From: Thijs Schreijer <thijs@...>
- Date: Mon, 7 Apr 2014 07:01:47 +0000
> -----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