lua-users home
lua-l archive

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


On 2023-03-28 14:28, Schmalzer, Lukas wrote:
Currently there is no way to yield from C. This behavior is
problematic for time critical applications, e.g., as in our
application, the execution environment for machine sequences.

Starting from Lua 5.2, there is a way called continuation.
A longjmp() is used when yielding from C side, destroying the
stackframe of course. But it is possible to specify a
continuation function to run when the coroutine is required to
resume. [1]

--
Ziyao

[1]: http://www.lua.org/manual/5.4/manual.html#4.5