[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: LuaJIT: maturity
- From: "Jerome Vuarand" <jerome.vuarand@...>
- Date: Wed, 23 Jul 2008 07:57:09 -0400
2008/7/23 Manish Jain <firstname.lastname@example.org>:
>>> Without LuaThread you can have several independent Lua states, even
>>> many of them, and in that case LuaJIT will work just as expected. You
>>> will have to use special mechanisms to share data between the Lua
>>> states, and there are many libs around there doing that, the authors
>>> of the active ones will probably answer this topic soon.
> We are not using LuaThread. We are calling Lua functions from C code.
> And there will be multiple threads in C code those will be calling same
> lua function in parallel.
You cannot access a single Lua state simultaneously from several
threads. You have to implement a locking mechanism, as Ong hean kuan
suggested. That's what LuaThread does, and you are probably already
doing it since otherwise you generally get problems quickly.
In that situation (a single locked Lua state), the use of LuaJIT is
transparent, it's a drop-in replacement for the default Lua