Return-Path: X-Original-To: apmail-commons-dev-archive@www.apache.org Delivered-To: apmail-commons-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 252314D70 for ; Wed, 11 May 2011 12:43:26 +0000 (UTC) Received: (qmail 17846 invoked by uid 500); 11 May 2011 12:43:25 -0000 Delivered-To: apmail-commons-dev-archive@commons.apache.org Received: (qmail 17754 invoked by uid 500); 11 May 2011 12:43:25 -0000 Mailing-List: contact dev-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Developers List" Delivered-To: mailing list dev@commons.apache.org Received: (qmail 17746 invoked by uid 99); 11 May 2011 12:43:25 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 May 2011 12:43:25 +0000 X-ASF-Spam-Status: No, hits=0.7 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [193.252.22.128] (HELO smtp5.freeserve.com) (193.252.22.128) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 May 2011 12:43:16 +0000 Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf3418.me.freeserve.com (SMTP Server) with ESMTP id 2D5CC1C00FA6 for ; Wed, 11 May 2011 14:42:56 +0200 (CEST) Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf3418.me.freeserve.com (SMTP Server) with ESMTP id 1F5E51C00FA7 for ; Wed, 11 May 2011 14:42:56 +0200 (CEST) Received: from mail.homeinbox.net (unknown [2.24.222.150]) by mwinf3418.me.freeserve.com (SMTP Server) with ESMTP id 013381C00FA6 for ; Wed, 11 May 2011 14:42:56 +0200 (CEST) X-ME-UUID: 20110511124256506.013381C00FA6@mwinf3418.me.freeserve.com Received: from localhost (localhost [127.0.0.1]) by mail.homeinbox.net (Postfix) with ESMTP id 951FBEAAA17 for ; Wed, 11 May 2011 13:42:55 +0100 (BST) X-Virus-Scanned: Debian amavisd-new at homeinbox.net Received: from mail.homeinbox.net ([127.0.0.1]) by localhost (mail.homeinbox.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id jNjO2lvD9JjE for ; Wed, 11 May 2011 13:42:49 +0100 (BST) Received: from [192.168.23.9] (study03.dev.local [192.168.23.9]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.homeinbox.net (Postfix) with ESMTPSA id 5BFD6EAAA1B for ; Wed, 11 May 2011 13:42:49 +0100 (BST) Message-ID: <4DCA8445.1080804@apache.org> Date: Wed, 11 May 2011 13:42:45 +0100 From: Mark Thomas User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-GB; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 MIME-Version: 1.0 To: Commons Developers List Subject: Re: svn commit: r1101516 - in /commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl: GenericObjectPool.java PooledObject.java PooledObjectState.java References: <20110510154823.30ED22388980@eris.apache.org> <4DC9F3C6.6050404@gmail.com> <4DCA03DF.3030509@gmail.com> <4DCA658A.4060005@apache.org> In-Reply-To: <4DCA658A.4060005@apache.org> X-Enigmail-Version: 1.1.1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org On 11/05/2011 11:31, Mark Thomas wrote: > On 11/05/2011 04:34, Phil Steitz wrote: >> On 5/10/11 7:26 PM, Phil Steitz wrote: >>> On 5/10/11 8:48 AM, markt@apache.org wrote: >>>> Author: markt >>>> Date: Tue May 10 15:48:22 2011 >>>> New Revision: 1101516 >>>> >>>> URL: http://svn.apache.org/viewvc?rev=1101516&view=rev >>>> Log: >>>> Move to using LinkedBlockingDeque for the queue of idle objects. >>> Definitely simpler, cleaner code, but seems there will be no easy >>> way to enable fairness and some badly "unfair" stuff can happen when >>> clients get instances under maintenance. In theory, an unlucky >>> client could wait forever. Do we have any data on how "unfair" >>> LinkedBlockingDeque can be? ArrayBlockingQueue is an alternative >>> that does support fairness; but then I guess we lose LIFO/FIFO >>> control and probably performance. Any ideas how we could get >>> fairness, or at least some control over fairness to work? Another >>> thing to think about is whether clients are better off waiting for >>> the state change on instances under maintenance than getting back in >>> line for the next available instance. (I now see the fairness TODO >>> in TestGOP :) >> >> After looking quickly at the Harmony code for LinkedBlockingDeque, >> we may be able to solve both the 1.6 problem and fairness by >> bringing that source in and just making the ReentrantLock that it >> uses configurable to be either fair or not (as ArrayBlockingQueue >> does). Might be naive, but might work. > > I like it. A lot. Great idea. Better still, it is faster than whatever Oracle wrote for Java 6 :) With this in place, DBCP is slightly faster than jdbc-pool for jdbc-pools checkout thread tests. This is only two microbenchmarks (there are lots of other tests where jdbc-pool is faster but I haven't optimized DBCP for those yet) but it is a promising sign. I just need to tidy up the code before I check it in. Mark --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org For additional commands, e-mail: dev-help@commons.apache.org