Stefan Hajnoczi <stefa...@gmail.com> writes: > On Wed, Jun 27, 2012 at 8:59 AM, Peter Maydell <peter.mayd...@linaro.org> > wrote: >> On 27 June 2012 08:48, Stefan Hajnoczi <stefa...@gmail.com> wrote: >>> I'd like to see your code though because I still don't understand why >>> it relies on the exact yield behavior. Have you pushed it to a public >>> git repo? >> >> I haven't seen Peter's code either, but his complaint makes sense >> to me -- the whole point of coroutines is that you can rely on >> the exact yield behaviour, surely. > > Not if you call coroutine_fn functions - these are explicitly marked > as functions that yield. For example block or net I/O.
I think you two are in violent agreement :) With coroutines, you can rely on the exact yield behavior. Of course, that doesn't do you any good unless you know which functions can yield. We make that easy by giving such functions distinctive names. Except when we don't: > The issue here is that there are some block.h functions that are not > marked coroutine_fn but actually yield if running inside coroutine > context. I think we could get rid of them with a little bit of work. Sounds like a good idea.