From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:38255) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R236Z-0006oV-TR for qemu-devel@nongnu.org; Fri, 09 Sep 2011 11:35:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R236Z-0003sb-62 for qemu-devel@nongnu.org; Fri, 09 Sep 2011 11:34:59 -0400 Received: from mail-vw0-f53.google.com ([209.85.212.53]:60861) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R236Z-0003sU-3l for qemu-devel@nongnu.org; Fri, 09 Sep 2011 11:34:59 -0400 Received: by vws13 with SMTP id 13so1459997vws.12 for ; Fri, 09 Sep 2011 08:34:58 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <4E6A321D.3090800@redhat.com> Date: Fri, 09 Sep 2011 17:34:53 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1315495505-28906-1-git-send-email-pbonzini@redhat.com> <1315495505-28906-12-git-send-email-pbonzini@redhat.com> <4E6A2818.7070209@bytemark.co.uk> <4E6A2AA6.3070900@redhat.com> In-Reply-To: <4E6A2AA6.3070900@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 11/12] nbd: switch to asynchronous operation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, qemu-devel@nongnu.org, Nicholas Thomas On 09/09/2011 05:03 PM, Paolo Bonzini wrote: > >> I'm a bit unsure here, actually. So you lock a mutex, send a request, >> wait for a response, then unlock the mutex. Surely this code doesn't >> allow more than one request to be in flight at a time? > > No, it doesn't. It shouldn't be hard to do it though. You could have > two mutexes, one for sending and one for receiving. You yield after > sending, and let nbd_coroutine_restart read the reply. It can then > reenter that reply's coroutine based on the handle in the reply. I > still prefer to do it in a separate patch. There is a problem with discard requests because they are not coroutine based (yet). But it would be the same even in your AIO implementation, unfortunately. Paolo