[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: In lua VM , can i yield after some bytecode executed?
- From: cometwk <cometwk@...>
- Date: Thu, 13 Aug 2009 01:19:07 +0800
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.