[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Coroutines Again :)
- From: Edgar Toernig <froese@...>
- Date: Wed, 27 Dec 2000 14:28:24 +0100
Daniel Krenn wrote:
> ** Also, would anyone have any solid examples of coroutine
I'll make a first snapshot of my derivate of Lua that includes
coroutines in about 2 weeks.
> i.e. how to handle multiple (i.e. hundreds, maybe thousands) of
> independant characters in a persistant world which need to fully
> interact with one another? We're very new to scripting, and have
> had little luck trying to find help on this particular topic :(
I have to make some notes here.
My coroutine implementation is not system independent because it
uses C coroutines and these cannot be made with ANSI functions.
And about thousands of coroutines: that's where coroutines would
really shine. Unfortunately, my implementation creates a fixed
stack for Lua and one for C for _each_ coroutine. You can set
these sizes during coroutine creation but I would say, a total
of less than 4kByte/coroutine becomes ... hmm... dangerous *g*.
So, with thousands of them you get pretty heavy memory usage.