My code, Lua Lanes, is an addon library so it requires no patching
to Lua
itself. You'd bring up one "lane" (separate Lua state, and OS
thread) that
would take in the callbacks and forward them to Lindas, which are
inter-state coordinated data moving vehicles. Think of them as
shared tables
(with FIFO behaviour if required).
Here's my understanding of the situation: the callback (a lua
function) is going to be called from a thread in the asynchronous
library, which needs the lua state in which the callback resides to be
in a consistent state at the moment of entrance. Considering that the
state is the state of a lua lane, the question is: can I suspend a
lane into a *reentrant* position of its lua state, and only after it
ran some initialization code (I need it to load the callback function
in the first place)? Does this makes any sense to you or am I asking
the wrong questions here?