[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Lua threads share global data?
- From: John Klimek <jklimek@...>
- Date: Thu, 22 Dec 2005 16:04:04 -0500
Thanks for the information!
So... threads share the global environment with the parent lua_state.
Therefore, if I change a global variable in my thread, it WILL also
change in the parent lua_state.
How can I prevent this and give my thread it's own global environment?
The idea is so that each lua_state thread can have it's own individual
global variable called "Connection" or whatever and each thread won't
be overwritting each others data.
On 12/21/05, Rici Lake <email@example.com> wrote:
> On 21-Dec-05, at 8:46 PM, John Klimek wrote:
> > Rici: Thanks for the link! It seems to talk a lot about "closures"
> > but I'm not sure what they are. I've searched the Wiki and have seen
> > some information but it was still a bit confusing... Can you explain
> > this a little more to me?
> Programming in Lua devotes a chapter to the subject:
> <http://www.lua.org/pil/6.1.html>. But the short answer is that a
> "closure" is the first-class Lua object which you probably think of as
> a function.