From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:49987) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qm0vL-0001NK-Fs for qemu-devel@nongnu.org; Wed, 27 Jul 2011 06:01:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qm0vI-00080b-Ue for qemu-devel@nongnu.org; Wed, 27 Jul 2011 06:01:07 -0400 Received: from mx1.redhat.com ([209.132.183.28]:5941) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qm0vI-00080V-Fo for qemu-devel@nongnu.org; Wed, 27 Jul 2011 06:01:04 -0400 Message-ID: <4E2FE28D.5060206@redhat.com> Date: Wed, 27 Jul 2011 12:03:57 +0200 From: Kevin Wolf MIME-Version: 1.0 References: <1311672077-4592-1-git-send-email-stefanha@linux.vnet.ibm.com> <8739hs5a6n.fsf@skywalker.in.ibm.com> In-Reply-To: <8739hs5a6n.fsf@skywalker.in.ibm.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v8 0/5] Coroutines for better asynchronous programming List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Aneesh Kumar K.V" Cc: Blue Swirl , Anthony Liguori , Venkateswararao Jujjuri , Stefan Hajnoczi , qemu-devel@nongnu.org Am 27.07.2011 11:45, schrieb Aneesh Kumar K.V: > On Tue, 26 Jul 2011 10:21:12 +0100, Stefan Hajnoczi wrote: >> QEMU is event-driven and suffers when blocking operations are performed because >> VM execution may be stopped until the operation completes. Therefore many >> operations that could block are performed asynchronously and a callback is >> invoked when the operation has completed. This allows QEMU to continue >> executing while the operation is pending. >> >> The downside to callbacks is that they split up code into many smaller >> functions, each of which is a single step in a state machine that quickly >> becomes complex and hard to understand. Callback functions also result in lots >> of noise as variables are packed and unpacked into temporary structs that pass >> state to the callback function. >> >> This patch series introduces coroutines as a solution for writing asynchronous >> code while still having a nice sequential control flow. The semantics are >> explained in the second patch. The fourth patch adds automated tests. >> >> A nice feature of coroutines is that it is relatively easy to take synchronous >> code and lift it into a coroutine to make it asynchronous. Work has been done >> to move qcow2 request processing into coroutines and thereby make it >> asynchronous (today qcow2 will perform synchronous metadata accesses). This >> qcow2 work is still ongoing and not quite ready for mainline yet. >> >> v8: >> * Bisectability: introduce gthread implementation before ucontext/fibers > > Can we also get CoMutex and CoQueue patches also merged. I use them in > the VirtFS series. > > http://repo.or.cz/w/qemu/kevin.git/shortlog/refs/heads/coroutine-devel > http://repo.or.cz/w/qemu/v9fs.git/commit/318ef0b9b01cd296f8c30d8288139b9bed859892 I introduce these in my block coroutine patches. I posted a RFC last week and the first "real" patch series yesterday, so I hope they get review and can be merged into master soon. Kevin