[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: lua_resume and a C-function as the main coroutine function problem
- From: "Robert G. Jakabosky" <bobby@...>
- Date: Tue, 13 Apr 2010 20:34:05 -0800
On Tuesday 13, Mark Feldman wrote:
> Sorry, ignore all that, turns out my code was working with an older
> version of Lua. That's a real shame, having some sort of portable
> support for C-function coroutines would be useful :(
The CoCo patch for Lua 5.1 will allow you to yield/resume from C functions.
http://coco.luajit.org/
It isn't pure C code, since it has to used assembly to switch C-stacks, but it
might work for you. Also id doesn't change the Lua API and you don't have to
use the switch hack to resume your C function.
--
Robert G. Jakabosky