|
于 2012-8-25 19:12, Gao Xianchao 写道:
it's nothing wrong with lua_pcallk. you just can't yield from the main thread. Lua's `thread' is asymmetric, i.e. the so called `collaborative multithreading', which is actually just a programming model. it is not true multithreading. the **asymmetric** nature means we need two different APIs to deal with `thread'. i.e. the `resume' and 'yield'. the **asymmetric** also means there must be one and the only `main thread', which behaves differently from all other threads. so you must first understand the `threading' model of Lua, then use the right API. |