> I read this page but
unfortunately, it only explains how to lock and mutex b/w
thread, not how to share a function reference w/o locking.
The
page explains how you could use one Lua environment
from multiple threads. It does need a mutex to protect its
internal structures, but that does not make you "rely on
main thread activities". With this approach, both of your
threads can call lua_pcall with the same Lua environment
concurrently, meaning that callbacks can run concurrently
with the main thread.