lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


In my project , I want to schedule two or more lua VMs in one native thread.
in this way, the scheduler between VMs is preemptive .

example:

main()
{
lua_resume(VM1)
VM1 -> execute bytecode1, bytecode2, bytecode-N then yield
lua_resume(VM2)
VM2 -> execute bytecode1, bytecode2, bytecode-N then yield
...
}

I know lua_yield() and lua_resume() can do this,
but how to do after some bytecode executed ?

or insert a bytecode (YIELD) into the lua bytecodes ?

Sorry for my poor english.