[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: luajit ffi - calling a luajit function via a C function pointer?
- From: Leo Razoumov <slonik.az@...>
- Date: Fri, 11 Feb 2011 14:53:55 -0500
On Fri, Feb 11, 2011 at 05:27, Mike Pall <email@example.com> wrote:
> I haven't mentioned one rather strange way out of this: perform
> inversion of control by switching C stacks.
> This is a bit like Lua coroutines work, where the iterator yields
> and eval_func() resumes. Except that we're switching C stacks, not
> Lua stacks.
> You could implement something like this right now, even without
> any changes to LuaJIT. You'll just have to grab one of the
> lightweight C coroutine libraries and add the required plumbing.
This is very interesting approach which can be useful in many places
call chain is needed. I can go google for lightweight C coroutine
libraries but if someone has specific recommendations it would help.