[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Any suggestion for a robust C coroutine library which can be used with LuaJIT ?
- From: Johnson Lin <arch.jslin@...>
- Date: Fri, 6 Jan 2012 18:56:43 +0800
On Thu, Jan 5, 2012 at 10:09 PM, Javier Guerra Giraldez
<javier@guerrag.com> wrote:
> On Thu, Jan 5, 2012 at 8:31 AM, Johnson Lin <arch.jslin@gmail.com> wrote:
>> On a second glimpse at libCoroutine, I think adding a wrapper around
>> the simple C API and encapsulate some kind of buffer for value passing
>> when switching might be doable.
>
> i haven't seen libCoroutine; but since coroutines are all about
> nonconcurrency, it sounds reasonably easy to just use a static pointer
> or struct to hold any parameters. no need to allocate buffers, since
> there won't be more than a single yield()/resume() happening at a
> time.
>
> --
> Javier
>
Haven't finished my crude benchmark yet, but it seemed that
Boost.Context currently don't work with mingw-gcc. There must be come
work around but the codebase is really too complex... I can hardly
read inside boost headers. Maybe something about bjam as well.
However, one thing is quite definitive. Boost.Context's static-release
build is about 500KB on my machine, while libcoroutine is less than
10KB (If I didn't get anything wrong...), libcoroutine depends on a
basekit from the same author, but it turns out that only 3 files from
that library are needed. So I just simply copied them into
libcoroutine.
I've tried this one as well:
http://www.akira.ruc.dk/~keld/research/COROUTINE/
but after fixing some code in it to work with gcc 4.5, I still can't
quite get the idea of its API. Maybe libcoroutine is my best bet for
now.
best regards,
Johnson Lin