[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Pausing a lua script from the C/C++ code.
- From: "Javier Guerra" <javier@...>
- Date: Tue, 8 Jul 2008 10:36:33 -0500
On Tue, Jul 8, 2008 at 10:25 AM, Brandon <email@example.com> wrote:
> Thanks for the help, Raymond. I've looked into co-routines and
> lua_newthread, and they don't look like what I want. I think I might be
> on the wrong track with lua_yield and lua_resume.
yes they are.
you just have to understand how to use coroutines. for that, it's a
lot easier to start with a small prototype using Lua only (no C).
when you get the feel of how coroutines work, it won't be hard to use
them from C.
for starters, a coroutine is like a function that can yield() instead
of return. after that, you can resume() it and it'll continue right
after the yield()