3 ms·
the most starred co-routine C is: https://github.com/Tencent/libco https://github.com/Tencent/libco It's said golang learned from libtask: https://github.com
by ausjke 8y ago
the most starred co-routine C is:
https://github.com/Tencent/libco https://github.com/Tencent/libco
It's said golang learned from libtask:
https://github.com/jamwt/libtask https://github.com/jamwt/libtask
And something else:
https://github.com/baruch/libwire https://github.com/baruch/libwire
https://github.com/halayli/lthread https://github.com/halayli/lthread (multi-core friendly)
- byuu 8y agoDisappointing that Tencent took my library's name. I'd been using the name since 2006 or so. I guess you can't expect a two-letter lib* name to remain unique. My luck that theirs would become the most well known in this space, though.
- skolemtotem 8y agoHi Byuu! You're a cool guy and I hope I can be like you one day!
- ausjke 8y agohi byuu, are you going to add arm64 support? or considering C99? if I have multiple cores, what's the best way to leverage that along with libco? will cpu affinity help?
- byuu 8y agoAarch64 support will show up as soon as I can get a Linux distro running on it to test the implementation with. My understanding is the ARM ABI isn't as well defined, and you tend to need slightly different implementations per device, so it may not be as useful as simply using the setjmp version. You can set -DLIBCO_MP to get the co_active handle to be multi-threaded. Each preemptive thread would then have its own set of cooperative threads.
- petee 8y agoto be fair you should point out that libco is written in c++, where as OP is actually written in c
- cryptonector 8y agoHaving done a bunch of work on PuTTY, I have to say I am a fan of Simon Tatham's C co-routines [0] (basically, a C preprocessor meta-programmed super Duff's device). [0] https://www.chiark.greenend.org.uk/~sgtatham/coroutines.html https://www.chiark.greenend.org.uk/~sgtatham/coroutines.html