Execution can be interrupted, though, through debug hooks. It could be set up to yield every N instructions. [1]
There's a few caveats, though, in that this will not be called if you've called into C code. That is, you will only yield while executing code in the Lua interpreter.
There's a few caveats, though, in that this will not be called if you've called into C code. That is, you will only yield while executing code in the Lua interpreter.
1. https://pgl.yoyo.org/luai/i/lua_sethook