Am 06.03.2013 um 15:53 hat Stefan Hajnoczi geschrieben:
> CoQueue uses a BH to awake coroutines that were made ready to run again
> using qemu_co_queue_next() or qemu_co_queue_restart_all().  The BH
> currently runs in the iothread AioContext and would break coroutines
> that run in a different AioContext.
> 
> This is a slightly tricky problem because the lifetime of the BH exceeds
> that of the CoQueue.  This means coroutines can be awoken after CoQueue
> itself has been freed.

Does this really happen in practice? If so, that sounds like a bug to
me.

> Finally, I don't want to move unlock_queue and unlock_bh into
> AioContext.  That would break encapsulation - AioContext isn't supposed
> to know about CoQueue.

So what you would need here is "AioContext local storage". I wonder if
this will stay a requirement unique to CoQueues when AioContexts gain
wider use.

Kevin

Reply via email to