lua-users home
lua-l archive

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


It was thus said that the Great bil til once stated:
> >@ Sean:
> >   Single-threaded code is easier to reason about.  But one can make Lua
> > multi-threaded (as in, operating system level threads), but you will have to
> > implement the functions lua_lock() and lua_unlock() to generate a custom Lua
> > engine.
> This is not correct, I have a nice multithreading environment
> meanwhile running, all based on one base state with "tasks" (=threads)
> which can be created nicely by the user (I used a special task library
> for this, not the Lua coroutine library).

  So you share a single Lua state among multiple operating system level
threads?  Or are you talking about Lua coroutines?  The former (operating
system threads, like pthreads under Linux) sharing a single Lua state
require the implementation of lua_lock() and lua_unlock().

  -spc