On 07/28/2011 07:09 AM, Christoph Hellwig wrote:
On Wed, Jul 27, 2011 at 01:37:31PM +0100, Stefan Hajnoczi wrote:
Coroutines in the block layer [Kevin]
  * Programming model to simplify block drivers without blocking QEMU threads

Can anyone explain what the whole point of this is?  It really just is
a bit of syntactic sugar for the current async state machines.  What does
it buy us over going for real threading?

It is threading--just with a common locking model where a single big lock is held to make up for the fact that most of QEMU isn't reentrant.

By restructuring the code to be threaded, we can incrementally remove the big lock if we audit for use of non-reentrant functions and introduce more granular locking.

The whole ucontext/setjmp thing is just an optimization. I would hope it entirely disappears long term as we promote coroutines to full threads.

Regards,

Anthony Liguori





Reply via email to