From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony Liguori Subject: Re: [Qemu-devel] [RFC] Replace posix-aio with custom thread pool Date: Wed, 10 Dec 2008 12:50:17 -0600 Message-ID: <49400F69.8080707@codemonkey.ws> 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> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Andrea Arcangeli , qemu-devel@nongnu.org, kvm-devel To: Gerd Hoffmann Return-path: Received: from rn-out-0910.google.com ([64.233.170.187]:22542 "EHLO rn-out-0910.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755782AbYLJSuW (ORCPT ); Wed, 10 Dec 2008 13:50:22 -0500 Received: by rn-out-0910.google.com with SMTP id k40so571204rnd.17 for ; Wed, 10 Dec 2008 10:50:21 -0800 (PST) In-Reply-To: <493FFC8E.9080802@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: 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 > > >