Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 8761 invoked from network); 21 Nov 2006 16:04:48 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 21 Nov 2006 16:04:48 -0000 Received: (qmail 49856 invoked by uid 500); 21 Nov 2006 16:04:45 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 49829 invoked by uid 500); 21 Nov 2006 16:04:44 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 49819 invoked by uid 99); 21 Nov 2006 16:04:44 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Nov 2006 08:04:44 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (herse.apache.org: local policy) Received: from [32.97.182.141] (HELO e1.ny.us.ibm.com) (32.97.182.141) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Nov 2006 08:04:29 -0800 Received: from d01relay02.pok.ibm.com (d01relay02.pok.ibm.com [9.56.227.234]) by e1.ny.us.ibm.com (8.13.8/8.12.11) with ESMTP id kALG44YQ017185 for ; Tue, 21 Nov 2006 11:04:04 -0500 Received: from d01av04.pok.ibm.com (d01av04.pok.ibm.com [9.56.224.64]) by d01relay02.pok.ibm.com (8.13.6/8.13.6/NCO v8.1.1) with ESMTP id kALG40cT228020 for ; Tue, 21 Nov 2006 11:04:01 -0500 Received: from d01av04.pok.ibm.com (loopback [127.0.0.1]) by d01av04.pok.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id kALG3xen013463 for ; Tue, 21 Nov 2006 11:03:59 -0500 Received: from [127.0.0.1] (sig-9-48-57-120.mts.ibm.com [9.48.57.120]) by d01av04.pok.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id kALG3q4O012829 for ; Tue, 21 Nov 2006 11:03:58 -0500 Message-ID: <45632363.1080207@apache.org> Date: Tue, 21 Nov 2006 08:03:47 -0800 From: Daniel John Debrunner User-Agent: Thunderbird 1.5.0.8 (Windows/20061025) MIME-Version: 1.0 To: derby-dev@db.apache.org Subject: Re: Releasing latches when waiting for locks. When and why? References: <455E4FDF.5030600@amberpoint.com> <4561FE49.2000901@sbcglobal.net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Knut Anders Hatlen wrote: > Mike Matrigali writes: > >> Having said that it would be interesting if someone had time to >> implement a higher performance latch implementation and plug it in >> and see how much it helps. It would decrease the total time spent >> in lock manager. > > Ok, a new experiment: I removed the calls to LockFactory.latchObject() > and LockFactory.unlatch() in BasePage. Instead, I let BasePage check > manually whether it was latched and use wait/notifyAll if it was. The > patch (which is very simple) is attached. > The original decision to use the lock manager for the latches was to enable easier debugging of deadlocks during the early development of the store code. A local latch implementation, like Knut Anders made, does make a lot of sense, but does leave derby open to undetectable deadlocks. Given the performance gains it probably is worth the risk, especially since I don't think we've seen a problem with latch ordering for many years. Dan.