From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LASsp-0001yM-Sl for qemu-devel@nongnu.org; Wed, 10 Dec 2008 12:29:59 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LASso-0001xI-1F for qemu-devel@nongnu.org; Wed, 10 Dec 2008 12:29:58 -0500 Received: from [199.232.76.173] (port=53231 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LASsn-0001x1-Ph for qemu-devel@nongnu.org; Wed, 10 Dec 2008 12:29:57 -0500 Received: from mx2.redhat.com ([66.187.237.31]:52408) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LASsn-0004H9-BS for qemu-devel@nongnu.org; Wed, 10 Dec 2008 12:29:57 -0500 Message-ID: <493FFC8E.9080802@redhat.com> Date: Wed, 10 Dec 2008 18:29:50 +0100 From: Gerd Hoffmann MIME-Version: 1.0 Subject: Re: [Qemu-devel] [RFC] Replace posix-aio with custom thread pool References: <1228512061-25398-1-git-send-email-aliguori@us.ibm.com> <493E941D.4000608@redhat.com> <493E965E.5050701@us.ibm.com> <20081210164401.GF18814@random.random> <493FFAB6.2000106@codemonkey.ws> In-Reply-To: <493FFAB6.2000106@codemonkey.ws> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Andrea Arcangeli , qemu-devel@nongnu.org, kvm-devel >> To solve this in userland without kernel aio we'd need to open (not >> just dup) > > Why not just dup? I've implemented this and it seems to work. unix keeps the file pointer in the (global) file table. The (per-process) file descriptor table references the file table. opening twice gives you two file descriptor table entries referencing two file table entries. duping gives you two file descriptors referencing the *same* file table entry. Thus the two fds share the file pointer. HTH, Gerd