[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: recognizing whether a caller uses function result
- From: bil til <biltil52@...>
- Date: Thu, 23 Feb 2023 06:54:55 +0100
>@ 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).