What is "safe" to do in a hook function?
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: What is "safe" to do in a hook function?
- From: matias.guijarro@...
- Date: 2007年4月02日 14:20:48 +0200
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.