lua-users home
lua-l archive

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


>@ 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).

My multithreading exclusively uses the standard C Lua functions yieldk
and resume (and lua_pcallk for customer Lua command / string level
usage). This works nicely with very clear coding (no changes to Lua  C
code required, not necessary to invoke lua_lock and lua_unlock in my
own C code).