[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: Tony Finch <dot@...>
- Date: Wed, 14 Apr 2010 09:31:24 +0100
On Tue, 13 Apr 2010, Robert G. Jakabosky wrote:
>
> It isn't pure C code, since it has to used assembly to switch C-stacks, but it
> might work for you.
http://coco.luajit.org/portability.html
You can manipulate the stack pointer in C without mucking around inside
the guts of a jmp_buf using alloca() or C99 variable size arrays. There
are some toy example coroutine implementations using this idea at
http://dotat.at/cgi/git?p=picoro.git;a=heads
Tony.
--
f.anthony.n.finch <dot@dotat.at> http://dotat.at/
GERMAN BIGHT HUMBER: SOUTHWEST 5 TO 7. MODERATE OR ROUGH. SQUALLY SHOWERS.
MODERATE OR GOOD.