Return-Path: Delivered-To: apmail-lucene-java-dev-archive@www.apache.org Received: (qmail 73503 invoked from network); 20 Dec 2006 03:05:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 20 Dec 2006 03:05:20 -0000 Received: (qmail 46345 invoked by uid 500); 20 Dec 2006 03:05:25 -0000 Delivered-To: apmail-lucene-java-dev-archive@lucene.apache.org Received: (qmail 46297 invoked by uid 500); 20 Dec 2006 03:05:25 -0000 Mailing-List: contact java-dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-dev@lucene.apache.org Delivered-To: mailing list java-dev@lucene.apache.org Received: (qmail 46286 invoked by uid 99); 20 Dec 2006 03:05:25 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Dec 2006 19:05:25 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of yseeley@gmail.com designates 66.249.92.173 as permitted sender) Received: from [66.249.92.173] (HELO ug-out-1314.google.com) (66.249.92.173) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Dec 2006 19:05:15 -0800 Received: by ug-out-1314.google.com with SMTP id k40so2150509ugc for ; Tue, 19 Dec 2006 19:04:54 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:sender:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=J6w6wEDinxRu8aJDzb0VoRRHvZM9RoeHd8ZRBnyfT9yWcoYyXPoHdsCjRISlufpWj2AihcHVYm9IChIcwqjRJPPQHtYjmplEbUtea4iUHs7FF3LQ9ESFXL8nugd8fmrynS6T+NHbqRuxvj70RU3mKZI2915HGLfshVR9+qx1OEg= Received: by 10.82.172.15 with SMTP id u15mr1332798bue.1166583893813; Tue, 19 Dec 2006 19:04:53 -0800 (PST) Received: by 10.82.149.12 with HTTP; Tue, 19 Dec 2006 19:04:53 -0800 (PST) Message-ID: Date: Tue, 19 Dec 2006 22:04:53 -0500 From: "Yonik Seeley" Sender: yseeley@gmail.com To: java-dev@lucene.apache.org Subject: Re: [jira] Commented: (LUCENE-753) Use NIO positional read to avoid synchronization in FSIndexInput In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <6940085.1166578822372.JavaMail.jira@brutus> X-Google-Sender-Auth: a1ad46f39909586c X-Virus-Checked: Checked by ClamAV on apache.org On 12/19/06, robert engels wrote: > That is what I did in my implementation. > > It is easy to implement this as a protected abstract method in > IndexInput, which uses synchronization (and seek(), read(byte > [],off,len). In the 'real" version just override it to do it properly > without using seek(). You can synchronize and protect other calls to that same pread method, but it breaks if it's called concurrently with most other methods because they aren't synchronized. It's not "thread-safe" in the normal sense of the word. One would have to specify that if you were going to use an IndexInput from multiple threads at once, that you could *only* use the pread method, and pretty much no others without external synchronization. That's doable I guess, but complicated to try to explain to others. -Yonik > > On Dec 19, 2006, at 7:40 PM, Yonik Seeley (JIRA) wrote: > > > [ http://issues.apache.org/jira/browse/LUCENE-753? > > page=comments#action_12459805 ] > > > > Yonik Seeley commented on LUCENE-753: > > ------------------------------------- > > > > CSIndexInput synchronization could also be elimitated if there was > > a pread added to IndexInput > > > > public abstract void readBytes(byte[] b, int offset, int len, > > long fileposition) > > > > Unfortunately, that would break any custom Directory based > > implementations out there, and we can't provide a suitable default > > with seek & read because we don't know what object to synchronize on. > > Worth it or not??? > > > >> Use NIO positional read to avoid synchronization in FSIndexInput > >> ---------------------------------------------------------------- > >> > >> Key: LUCENE-753 > >> URL: http://issues.apache.org/jira/browse/LUCENE-753 > >> Project: Lucene - Java > >> Issue Type: New Feature > >> Components: Store > >> Reporter: Yonik Seeley > >> Attachments: FSIndexInput.patch > >> > >> > >> As suggested by Doug, we could use NIO pread to avoid > >> synchronization on the underlying file. > >> This could mitigate any MT performance drop caused by reducing the > >> number of files in the index format. > > --------------------------------------------------------------------- To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org For additional commands, e-mail: java-dev-help@lucene.apache.org