lua-users home
lua-l archive

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


   I read the manual of lua5.0 beta and cannot find enough information
to use coroutine. Maybe I'm not enough familiar with lua?
   My current project is a RPG game.
   In this project, I plan to build a main lua thread and a few coroutine 
thread.  The engine functions(by C++) are registered into the main thread, then 
coroutines are created for entities such as NPC, triggers. The coroutines can
use the engine functions since threads share global tables with the main thread.
   I know how to create coroutines with lua language but don't know how to
do that with C interface.
   Is it a correct way to integrate coroutine? Any sample to use it is appreciated.