4 ms·
Libtask: a Coroutine Library for C and Unix
- witten 17y agoIf you're looking for something like this for Python, check out the greenlet library: http://pypi.python.org/pypi/greenlet http://pypi.python.org/pypi/greenlet
- uriel 17y agoVery nice, I really like stackless and anyone writing concurrent code in python should use it.
- draegtun 17y agoThere is also libcoro. In fact I think there's two of them ;-) First is http://www.freebsdsoftware.org/devel/libcoro.html http://www.freebsdsoftware.org/devel/libcoro.html Second is part of the excellent Coro Perl module: http://search.cpan.org/dist/Coro/ http://search.cpan.org/dist/Coro/
- limmeau 17y agoLibcoro's FreeBSD ports page claims to support i386 only, while Libtask supports i386, PowerPC, Sparc and ARM.
- james2vegas 17y agoI think that is inaccurate, and probably based on the backend they are using: * -DCORO_ASM * Handcoded assembly, known to work only on a few architectures/ABI: GCC + x86/IA32 and amd64/x86_64 + GNU/Linux and a few BSDs. The other backends use standard libc/SUSv2 calls like (get|set|swap)context, setjmp|longjmp and sigaltstack
- iheartmemcache 17y agoHow does this compare to libevent and other NIO libs?
- agazso 17y agoWhile libtask contains primitives for io (see fdread and other fd* functions) it uses poll() internally which does not scale well. And that is one of the problems that libevent solves by using the best available polling mechanism available. Libevent also provides timer and signal events while libtask does not.
- ralph 17y agoIt's unfortunate that he leaves channels until last and doesn't describe them fully. Understanding the benefits of structuring code to use channels is up there with other programming paradigms.