lua-users home
lua-l archive

What is "safe" to do in a hook function?

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


Hello,
I noticed that Lua hooks are usually used for
interrupting running Lua code (with a lua_error
call).
I wonder if it is "safe" (no stack corruption,
etc.) to do something else in a count hook :
for example calling other Lua functions, or
resuming a coroutine.
Otherwise, how would you do in order to be able
to execute Lua code periodically (e.g resuming
coroutines) while the main Lua state is doing
something else ? (e.g a big loop) without using
OS-level threads ?
Thanks in advance for your answers,
Matias.

AltStyle によって変換されたページ (->オリジナル) /