lua-users home
lua-l archive

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


On Friday 15 September 2006 7:15 pm, Luiz Henrique de Figueiredo wrote:
> > How much can I copy Lua data around between distinct
> > states (assuming thread safety is managed correctly)?
>
> If you have got your locking right, you can use lua_xmove if the Lua
> states are related (ie, children of the same Lua top state).

it would be great if there was any way to do that for unrelated Lua states.  i 
guess it's not a trivial thing, unfortunately.

in fact, each time i try to think how would that work, it's hard to even 
define a 'desired' specification (how deeply to copy, what to do with 
userdata, metatables, upvalues, etc)

thinking "the other way", a finer-grained lock for better concurrency between 
related states seems more promising in the long run, but that's far far away 
from my comfort zone.

a third approach is to have some communications API between states, hopefully 
something better than single values.  ideally, some way to define 'shared' 
data.  then the problem becomes how 'contagious' should the 'shariness' be... 
still no good ideas at the horizon.

-- 
Javier

Attachment: pgpF3SMNx2LEk.pgp
Description: PGP signature