From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LAU8f-0003DX-2N for qemu-devel@nongnu.org; Wed, 10 Dec 2008 13:50:25 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LAU8d-0003Ac-C4 for qemu-devel@nongnu.org; Wed, 10 Dec 2008 13:50:24 -0500 Received: from [199.232.76.173] (port=44653 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LAU8c-00039u-Gj for qemu-devel@nongnu.org; Wed, 10 Dec 2008 13:50:22 -0500 Received: from yx-out-1718.google.com ([74.125.44.154]:13241) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LAU8c-0007Rh-0c for qemu-devel@nongnu.org; Wed, 10 Dec 2008 13:50:22 -0500 Received: by yx-out-1718.google.com with SMTP id 3so286520yxi.82 for ; Wed, 10 Dec 2008 10:50:21 -0800 (PST) Message-ID: <49400F69.8080707@codemonkey.ws> Date: Wed, 10 Dec 2008 12:50:17 -0600 From: Anthony Liguori 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> <493FFC8E.9080802@redhat.com> In-Reply-To: <493FFC8E.9080802@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed 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: Gerd Hoffmann Cc: Andrea Arcangeli , qemu-devel@nongnu.org, kvm-devel Gerd Hoffmann wrote: >>> 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. > But opening twice means that you lose coherency with NFS. I hate Unix. Regards, Anthony Liguori > HTH, > Gerd > > >