[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Multi-threading with Lua
- From: Peter Cawley <lua@...>
- Date: Mon, 8 Jun 2009 23:51:04 +0100
On Mon, Jun 8, 2009 at 11:31 PM, Martin, Marcus<firstname.lastname@example.org> wrote:
> Each Lua interpreter is completely independent of every other
> interpreter. I could have as many as I want (memory permitting).
Yes, every Lua universe created by lua_newstate is completely
independent from every other Lua universe. There is no global
> Each Lua thread shares global state with all other threads in the
> creating interpreter unless I do something to prevent that.
A Lua thread created with lua_newthread will inherit the globals table
and registry table of the creating thread, but either of these can be
replaced by new, empty tables if required.