Hi there, I was reviewing the coroutine blogpost (
https://blog.vmsplice.net/2014/01/coroutines-in-qemu-basics.html) and had a
few questions about the example given. It states in the blog that it makes
the code sequential, but aren't the co_* requests in `void coroutine_fn
say_hello` seperate callbacks we need to implement, still leading to
callback hell?

Moreover it is stated that coroutines have to be explicitly yielded or
terminated. In the example we are using blocking functions (send and
readline), so how are we defining explicit yielding in such functions? For
example let's say I am waiting on a data being to a Chardev Frontend,
perform some operation on it and then respond to the Frontend when I am
able to write, how would I write a qemu_coroutine to deal with this? Are
coroutines even the right approach to use for such a flow?

Any relevant code snippet or QEMU implementation would be great!
Regards,
Irtaza

Reply via email to