[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Multiple related lua states
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Wed, 24 May 2006 08:49:35 -0300
> Does using lua threads actually imply that I must use a thread? In the
> model I am suggesting, only one application is 'live' at a time - you
> can imagine a main menu with apps hanging off it. You go into each app
> one at a time. No application concurrency.
>
> Can application access the threads global table (and by implication)
> access another application's data? Or can this be prottected in the
> manner you have described with the global table?
If there is no concurrency, then you may try to create a single parent
state containing your static data and functions and then load each
"application" into a separate child state for which the global table
has been changed to an empty table with an __index metamethod pointing
to the parent global table. All static data will be seen in the child
state but they'll be protected against wrtiting.
--lhf