lua-users home
lua-l archive

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


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?