lua-users home
lua-l archive

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


> Normally, you can't share a table (or other gc objects) between dirrent Lua `universe',
> Each Lua global state has its own heep and gc, and Lua's C API doesn't expose gc objects
> to outside the Lua core.

That's a point. I didn't think of the gc.

> However, if you are ok to go beyond the API, you can of course access and play with the
> internal data structures, _ON YOUR OWN RISK_.
> That said, _never really do it_.
> 
> 
> In your case, I suppose you'd better rethink your design. Since you don't need two Lua
> interpreters to run concurrently, why the need to use two different Lua interpreters at
> all? Can't you just use a single Lua interpreter and run your scripts in different
> coroutines instead? Your application code then schedules the coroutines.

So it seems that I either have to stick on my additional module (which
doesn't invoke the gc when adding/deleting/modifying a variable) or to
following the coroutine approach.

Anyway - thank you all for your suggestions and inside views. It will
save me a lot of time trying to get a global table running.

Best regards

Joachim