lua-users home
lua-l archive

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


>  is lua thread-safe, ie, whether i can guarantedly
> "safely" use two different contexts of luavm in two
> separate threads of same program.

Two Lua states created with lua_open are completely independent and can
be used in separate OS threads of same program. Child states created
with lua_newthread cannot be used in separate OS threads unless you
compile Lua with support for that, by defining lua_lock and lua_unlock
adequately for your locking needs.
--lhf