From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52984) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WGT0a-0005yv-41 for qemu-devel@nongnu.org; Thu, 20 Feb 2014 07:45:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WGT0R-00006B-1y for qemu-devel@nongnu.org; Thu, 20 Feb 2014 07:45:44 -0500 Received: from mail-wg0-x22c.google.com ([2a00:1450:400c:c00::22c]:61519) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WGT0Q-00005w-NZ for qemu-devel@nongnu.org; Thu, 20 Feb 2014 07:45:34 -0500 Received: by mail-wg0-f44.google.com with SMTP id k14so1421172wgh.35 for ; Thu, 20 Feb 2014 04:45:33 -0800 (PST) Date: Thu, 20 Feb 2014 13:45:30 +0100 From: Stefan Hajnoczi Message-ID: <20140220124530.GB15847@stefanha-thinkpad.redhat.com> References: <1389318316-18841-1-git-send-email-stefanha@redhat.com> <1389318316-18841-3-git-send-email-stefanha@redhat.com> <20140120102950.GB5727@T430.nay.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140120102950.GB5727@T430.nay.redhat.com> Subject: Re: [Qemu-devel] [RFC v2 2/6] aio: add aio_context_acquire() and aio_context_release() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: Kevin Wolf , Michael Roth , qemu-devel@nongnu.org, Stefan Hajnoczi , Igor Mammedov , Paolo Bonzini On Mon, Jan 20, 2014 at 06:29:50PM +0800, Fam Zheng wrote: > On Fri, 01/10 09:45, Stefan Hajnoczi wrote: > > +/* Take ownership of the AioContext. If the AioContext will be shared between > > + * threads, a thread must have ownership when calling aio_poll(). > > + * > > + * Note that multiple threads calling aio_poll() means timers, BHs, and > > + * callbacks may be invoked from a different thread than they were registered > > + * from. Therefore, code must use AioContext acquire/release or use > > + * fine-grained synchronization to protect shared state if other threads will > > + * be accessing it simultaneously. > > + */ > > +void aio_context_acquire(AioContext *ctx); > > + > > +/* Reliquinish ownership of the AioContext. */ > > s/Reliquinish/Relinquish/ Fixed in next version.