From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38758) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZCk9f-00061z-HM for qemu-devel@nongnu.org; Wed, 08 Jul 2015 03:52:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZCk9c-0002OX-Ct for qemu-devel@nongnu.org; Wed, 08 Jul 2015 03:52:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46481) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZCk9c-0002Nr-7H for qemu-devel@nongnu.org; Wed, 08 Jul 2015 03:52:28 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id E213E371B78 for ; Wed, 8 Jul 2015 07:52:26 +0000 (UTC) References: <1424449612-18215-1-git-send-email-pbonzini@redhat.com> <1424449612-18215-3-git-send-email-pbonzini@redhat.com> <20150708021832.GG10382@ad.nay.redhat.com> From: Paolo Bonzini Message-ID: <559CD6B7.9070103@redhat.com> Date: Wed, 8 Jul 2015 09:52:23 +0200 MIME-Version: 1.0 In-Reply-To: <20150708021832.GG10382@ad.nay.redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 2/3] AioContext: acquire/release AioContext during aio_poll List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: qemu-devel@nongnu.org On 08/07/2015 04:18, Fam Zheng wrote: >> > @@ -267,7 +268,13 @@ bool aio_poll(AioContext *ctx, bool blocking) >> > timeout = blocking ? aio_compute_timeout(ctx) : 0; >> > >> > /* wait until next event */ >> > + if (timeout) { >> > + aio_context_release(ctx); >> > + } >> > ret = qemu_poll_ns((GPollFD *)pollfds, npfd, timeout); > If two threads poll concurrently on this ctx, they will get the same set of > events, is that safe? Doesn't that lead to double dispatch? Yes, but handlers should be okay with spurious wakeup. They will just get EAGAIN. Paolo