I can see two different addresses (that are outputed) in the console indeed.
3.But the answer seems to be no since this post below.
As per the post(
which says that[emphasis mine]:
> Can lua_sethook be called on a coroutine? Will it interrupt
> only the coroutine or also the main "thread/coroutine"?
For Lua you need to set it on each coroutine separately. This can
get difficult, because you are not notified when a new coroutine
is created. For LuaJIT you only need to set it once and it applies
to all coroutines.
> Here is an example:
> Should lua_sethook call "hook" on l thread or on both l and j threads?
With LuaJIT it applies to both (output is abababa...). With Lua it
only applies to 'l' (output is bbbb... because 'j' never yields).
> lua_sethook(l, hook, LUA_MASKLINE, 0);