3 ms·
Went to look to look for this library. Looks like the website for that project is gone: https://byuu.org/library/libco/ https://byuu.org/library/libco/ So unle
by anfilt 4y ago
Went to look to look for this library. Looks like the website for that project is gone: https://byuu.org/library/libco/ https://byuu.org/library/libco/
So unless there is an authoritative mirror somewhere I can't tell you.
- bonzini 4y agohttps://github.com/creationix/libco https://github.com/creationix/libco
- ranger_danger 4y agothat one is old and missing aarch64. here's the latest https://github.com/ares-emulator/ares/tree/master/libco https://github.com/ares-emulator/ares/tree/master/libco
- anfilt 4y agoSo looking at that. I will say if you look at the API exposed in "libco.h" it's does not offer a ton options other than context switching cothread_t co_active(void); cothread_t co_derive(void, unsigned int, void ()(void)); cothread_t co_create(unsigned int, void (*)(void)); void co_delete(cothread_t); void co_switch(cothread_t); int co_serializable(void); Also it uses malloc to create the stacks. My library lets decide how wish to allocate stacks with. On linux I recommend mmap since you can create guard pages and such, but it's completely up to. Also I have functions that can let you call an other function on thread stack. This is handy to let you call a function that generates a deep call stack. Otherwise you have to mess around hopping back and forth between couroutines and the main thread context.