[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: How to control Lua VM execute time
- From: chuang <lichuang1982@...>
- Date: Mon, 17 Dec 2012 11:20:26 +0800
If in a C thread there are more than one Lua states to execute and I want to scheduler them, like Erlang's process,such as control the Lua VM executing time,how to achieve this goal?
One method is that use coroutine, and set a hook function in every Lua state,every time the Lua VM execute an opcode,it will check the hook function and in this function can yield and resume another Lua VM.But I think this method is not effective enough,so is there a nice and better solution?