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

is it worth to create coroutine inside coroutine? #42

Closed ReiiSky closed 2 years ago

ReiiSky commented 4 years ago

i just wondering what's technique to create co inside co, does its affect performance.

by example i want to create few co inside non-main co, so what should i do, like:

  1. creating share stack variable in global heap instead in co local variable?
  2. how much stack size for main share stack and share stack inside co-main function?

also one more question, documentation said to allocate local variable (especially the big one) on the heap, then what usage stack in a function good for? there is some technique to calculate how much w should allocate the share stack size?

i need advise for this, i hope someone give me some tips or anything.

thanks, sorry for my bad english.