lua-users home
lua-l archive

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


Read up on lua_resume() and lua_yield(). It works rather well with a few
minor constraints. If you want fully resumable C coroutines. See Mike
Palls COCO, which removes the constraints.

db

bert hubert wrote:
On Sun, Dec 24, 2006 at 05:40:09PM -0200, Roberto Ierusalimschy wrote:
> > There might be other ways to achieve the same thing (run everything in Lua
> > with coroutines, for example), but that doesn't fit my current architecture.
>
> What do you mean coroutines do not fit your architecture? It seems to
> me that what you are describing is exactly coroutines: getLine yields,
> and then sometime later you push the result in line on the stack and
> resume that coroutine.

I can actually do that from C? If so, that would be wonderful!

Thanks.

--
http://www.PowerDNS.com      Open source, database driven DNS Software
http://netherlabs.nl              Open and Closed source services