From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:55961) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDI57-0003lm-3C for qemu-devel@nongnu.org; Wed, 06 Mar 2013 12:24:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UDI55-0002YD-Bd for qemu-devel@nongnu.org; Wed, 06 Mar 2013 12:24:45 -0500 Received: from mail-yh0-x232.google.com ([2607:f8b0:4002:c01::232]:39550) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDI55-0002Xz-6n for qemu-devel@nongnu.org; Wed, 06 Mar 2013 12:24:43 -0500 Received: by mail-yh0-f50.google.com with SMTP id z20so1259945yhz.37 for ; Wed, 06 Mar 2013 09:24:42 -0800 (PST) Sender: Paolo Bonzini Message-ID: <51377BD5.3060500@redhat.com> Date: Wed, 06 Mar 2013 18:24:37 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1362584735-30911-1-git-send-email-stefanha@redhat.com> <1362584735-30911-4-git-send-email-stefanha@redhat.com> In-Reply-To: <1362584735-30911-4-git-send-email-stefanha@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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: Stefan Hajnoczi Cc: Kevin Wolf , qemu-devel@nongnu.org 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? > The reason why AioContext should have the ThreadPool is because the > ThreadPool is bound to a AioContext instance where the work item's > callback function is invoked. It doesn't make sense to keep the > ThreadPool pointer anywhere other than AioContext. For example, > block/raw-posix.c can get its AioContext's ThreadPool and submit work. > > Special note about headers: I used struct ThreadPool in aio.h because > there is a circular dependency if aio.h includes thread-pool.h. Otherwise, Reviewed-by: Paolo Bonzini Paolo