Just throwing it out there. I had written a module LuaStepper (
https://github.com/aryajur/LuaStepper ) with which you can load Lua Scripts, execute them concurrently, pause them and resume them. It works by setting hooks in the scripts so doesn't depend on any operating system threading. As mentioned before in this thread that the hook approach won't work if the script calls a blocking C function. To avoid that there are some mechanisms in the module to wrap any external code required by the script and then provide it to the executing script to control blocking behavior.