lua-users home
lua-l archive

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


On Mon, Apr 8, 2013 at 4:24 PM, Coda Highland <chighland@gmail.com> wrote:
> The Lua VM isn't threadsafe. You cannot have multiple threads
> accessing any part of the VM at the same time. Your locking scheme
> isn't good enough. If you want to access Lua from multiple threads,
> you need to lock your global lock every time you invoke the Lua
> interpreter, and never let go of it until it's done. And if you do
> that, you don't NEED to lock any C callback functions invoked from
> Lua, because the lock will already be established.

OK, but that means a callback, where a function in my LUA-script is
called asynchronously, isn't possible!? My LUA interpreter is running
all the time, the script is somehow "endless" (there is of course an
exit condition but it is intended to do some work for longer time).
And during this time I need to inject some additional information the
currently running script has to use...