lua-users home
lua-l archive

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


Hi
There are lots of samples... any agent or even scripted animation can use
coroutines. Loading stuff and yielding from time to time to let other tasks
being done (unless you don't thread those loading tasks anyway). Coroutines are
much easier to handle than real threads but offer many of their benefits. 
Only problem is, that lua coroutines can't yield across C calls - which can be
fixed using Coco, a package that allows yielding C calls. However, the lua
coroutines are quite inexpensive compared to OS coroutines that must be used
then. Creating 10000-100000 coroutines is no problem. However there's a much
lower limit for OS dependent coroutines / threads than that. 


> Hi.
> 
> 
> I'm studying Lua corotines, and looks very interesting.
> 
> Is there any sample of use of Lua corotines in games?
> 
> __________________________________________________
> Fale com seus amigos  de graça com o novo Yahoo! Messenger 
> http://br.messenger.yahoo.com/
>