From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gerd Hoffmann Subject: Re: [Qemu-devel] [RFC] Replace posix-aio with custom thread pool Date: Wed, 10 Dec 2008 18:29:50 +0100 Message-ID: <493FFC8E.9080802@redhat.com> 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> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Andrea Arcangeli , qemu-devel@nongnu.org, kvm-devel To: Anthony Liguori Return-path: Received: from mx2.redhat.com ([66.187.237.31]:47777 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752178AbYLJR35 (ORCPT ); Wed, 10 Dec 2008 12:29:57 -0500 In-Reply-To: <493FFAB6.2000106@codemonkey.ws> Sender: kvm-owner@vger.kernel.org List-ID: >> 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