c/c++ coroutines with setcontext
schmorp at schmorp.de
Fri May 22 17:28:12 CEST 2009
On Thu, May 21, 2009 at 05:06:42PM -0700, Eric Brown <yogieric.list at gmail.com> wrote:
> Has anybody created a libev based coroutine library with setcontext()?
The ucontext functions are a quite passable coroutine library already - I
can't see where coroutine libraries can be based on event libraries, they are
quite orthogonal concepts.
Also, tying yourself to an unportable interface such as setcontext is
probably not so good an idea (it doesn't work on many gnu/linux systems,
I know of no BSd variant where ucontext works, most commercial unices have
broken implementations, it has never been successfully standardised etc.).
There is a simple coroutine library called "libcoro", however, which is
rather portable (http://testers.cpan.org/show/Coro.html). It is quite
similar in spirit to libev: http://software.schmorp.de/pkg/libcoro.html
The choice of a Deliantra, the free code+content MORPG
-----==- _GNU_ http://www.deliantra.net
----==-- _ generation
---==---(_)__ __ ____ __ Marc Lehmann
--==---/ / _ \/ // /\ \/ / pcg at goof.com
More information about the libev