[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Is having lua_State per thread safe?
- From: Roberto Ierusalimschy <roberto@...>
- Date: Tue, 22 May 2012 10:44:02 -0300
> > A lua_State is completly isolated, so they are thread safe. (Has been since
> > Lua 4.0)
> Until Lua 5.0, the parser was not completely reentrant.
> So it is more correct to say that a lua_State is fully thread safe
> since Lua 5.1.
Reentrance in this case is not related to thread safety. The parser
in one state cannot be called while the parser in the same state is
working; the parser in a different state is completely unrelated.
Since Lua 4.0 Lua has multiple states, and different states do not share
any mutable data (even when parsing).