hnes / libaco

A blazing fast and lightweight C asymmetric coroutine library 💎 ⛅🚀⛅🌞
https://libaco.org
Apache License 2.0
3.51k stars 391 forks source link

Request: having a version of aco_yield() that receives the coroutine to where to yield #31

Open AltraMayor opened 4 years ago

AltraMayor commented 4 years ago

In the case I'm considering using libaco, I'll have less than 20 standalone non-main coroutines and the cost to switch between the coroutines is critical. The current cost of 10ns for acosw() fits my application, but having to go through the main coroutine first to switch to another non-main coroutine puts the cost of switching at 20ns, what becomes too much for what I'm trying to accomplish.

Is it possible to have a version of aco_yield() that receives the coroutine to where to yield?