From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:44658) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDXf7-0001Ii-ET for qemu-devel@nongnu.org; Thu, 07 Mar 2013 05:02:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UDXf4-0005Ge-Rc for qemu-devel@nongnu.org; Thu, 07 Mar 2013 05:02:57 -0500 Received: from mx1.redhat.com ([209.132.183.28]:19421) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDXf4-0005GZ-K0 for qemu-devel@nongnu.org; Thu, 07 Mar 2013 05:02:54 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r27A2seY002221 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 7 Mar 2013 05:02:54 -0500 Date: Thu, 7 Mar 2013 11:02:52 +0100 From: Stefan Hajnoczi Message-ID: <20130307100252.GA14726@stefanha-thinkpad.redhat.com> References: <1362584735-30911-1-git-send-email-stefanha@redhat.com> <1362584735-30911-4-git-send-email-stefanha@redhat.com> <51377BD5.3060500@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <51377BD5.3060500@redhat.com> Subject: Re: [Qemu-devel] [PATCH 3/5] aio: add a ThreadPool instance to AioContext List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Kevin Wolf , qemu-devel@nongnu.org On Wed, Mar 06, 2013 at 06:24:37PM +0100, Paolo Bonzini wrote: > Il 06/03/2013 16:45, Stefan Hajnoczi ha scritto: > > This patch adds a ThreadPool to AioContext. It's possible that some > > AioContext instances will never use the ThreadPool, so defer creation > > until aio_get_thread_pool(). > > What lock should protect against doing this twice? aio_get_thread_pool() is not thread-safe and I don't think it needs to be. I imagine it will only be called from the thread that runs the AioContext. Stefan