Return-Path: Delivered-To: apmail-click-dev-archive@www.apache.org Received: (qmail 68157 invoked from network); 4 Mar 2010 19:15:32 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 4 Mar 2010 19:15:32 -0000 Received: (qmail 90185 invoked by uid 500); 4 Mar 2010 19:15:21 -0000 Delivered-To: apmail-click-dev-archive@click.apache.org Received: (qmail 90167 invoked by uid 500); 4 Mar 2010 19:15:21 -0000 Mailing-List: contact dev-help@click.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@click.apache.org Delivered-To: mailing list dev@click.apache.org Received: (qmail 90160 invoked by uid 99); 4 Mar 2010 19:15:21 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Mar 2010 19:15:21 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of henry.saputra@gmail.com designates 209.85.217.216 as permitted sender) Received: from [209.85.217.216] (HELO mail-gx0-f216.google.com) (209.85.217.216) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Mar 2010 19:15:12 +0000 Received: by gxk8 with SMTP id 8so1184789gxk.9 for ; Thu, 04 Mar 2010 11:14:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=yZvlrHEFbkxSQneSqVc5Sbwp7H+N6RknJftGDvLbea8=; b=sCBBetreygzYVHv2oGikN6XfFYtKivsQ300YrY9zEHi4/LxcMUBUFnlH7t/OrQl4ly AYQhUMVXxTBNTuehdwf/iCZpZvY+s6MMEXLDC0a4vxCrcAowEBG6qphQD3Sc/9vnVxpa 0HsEC7zpyUtZl1eSLhvwpTBt7s3xoT9dJnuWU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=pTMYFa64EwBriei8wuzLARxexJ1nKI4YlZTIpWO4GxY3LGlRG2q0d+myAdjuD0tO0E KWPcRN8hZuX8GdSK43EXE0Z3MlCdy2jNwCwb758epFvs5YKyeFZ12Hak/sB4NdZfIwj7 DLaVeO62s40MQDHJDX4OT9Ra0uChVKTJ7MloA= MIME-Version: 1.0 Received: by 10.90.226.18 with SMTP id y18mr99591agg.81.1267730091628; Thu, 04 Mar 2010 11:14:51 -0800 (PST) In-Reply-To: <115591113.66621267704687919.JavaMail.jira@brutus.apache.org> References: <1661363576.4611267525047193.JavaMail.jira@brutus.apache.org> <115591113.66621267704687919.JavaMail.jira@brutus.apache.org> Date: Thu, 4 Mar 2010 11:14:51 -0800 Message-ID: <31bb1a8b1003041114x36ef9696xaa65d509c19acbd3@mail.gmail.com> Subject: Re: [jira] Closed: (CLK-636) Replace EDU.oswego.cs.dl.util.concurrent.ConcurrentReaderHashMap with java.util.concurrent.ConcurrentHashMap From: Henry Saputra To: dev@click.apache.org Content-Type: multipart/alternative; boundary=0016e6476a9cc85c190480fe694d X-Virus-Checked: Checked by ClamAV on apache.org --0016e6476a9cc85c190480fe694d Content-Type: text/plain; charset=UTF-8 Hi Malcolm, Thanks for your input for this bug. I understand the risk but I dont think this is the right solution since the more Java move to better concurrency support, sticking with the "deprecated" class will make the framework to be sluggish. Removing this dependency on Doug's concurrency package to Java EE concurrency package and supporting Java generics should make the Click framework to be more faster and efficient. I have used Spring 2.5 before with Java concurrent package before and never see any problem. - Henry On Thu, Mar 4, 2010 at 4:11 AM, Malcolm Edgar (JIRA) wrote: > > [ > https://issues.apache.org/jira/browse/CLK-636?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel] > > Malcolm Edgar closed CLK-636. > ----------------------------- > > Resolution: Won't Fix > > I appreciate the though around this issue but risk to production > applications using various Spring version is too high for the reward of > removing this class. > > regards Malcolm Edgar > > > Replace EDU.oswego.cs.dl.util.concurrent.ConcurrentReaderHashMap with > java.util.concurrent.ConcurrentHashMap > > > ------------------------------------------------------------------------------------------------------------ > > > > Key: CLK-636 > > URL: https://issues.apache.org/jira/browse/CLK-636 > > Project: Click > > Issue Type: Improvement > > Components: core > > Affects Versions: 2.2.0 > > Reporter: Henry Saputra > > Attachments: concurrentreader_patch.diff > > > > > > Since Click required Java SDK 1.5 or later, we could leverage the > java.util.concurrent.ConcurrentHashMap class to replace > EDU.oswego.cs.dl.util.concurrent.ConcurrentReaderHashMap class so reducing > the Click runtime dependency. > > In my opinion here are some good reasons why: > > 1. The ConcurrentHashMap class in Java SDK is more efficient since it > utilizes internal hash classes to support better granularity and concurrency > compare to simple syncrhonized on the instance like in > DU.oswego.cs.dl.util.concurrent.ConcurrentReaderHashMap. > > 2. Looking at the use case ConcurrentReaderHashMap in Click, it used to > cache the OGNL expression (please correct me if I am wrong). This scenario > does not need exclusive lock on update which is the intended/ preferred use > case for ConcurrentReaderHashMap. If there is a miss on OGNL expression on a > name in the cache, it will cerate one and put it to the map if no other > thread has not. So it will still perform as well as or better locking entire > table. However, if we do need exclusive lock on update, we can simulate > ConcurrentReaderHashMap with ConcurrentHashMap by setting concurrencyLevel > to one. > > 3. The ConcurrentHashMap support generic which is part of task being done > to move Click code to Java generics. > > 4. Looks like the > EDU.oswego.cs.dl.util.concurrent.ConcurrentReaderHashMap class is created by > Doug Lea before contributions to java.util.concurrent packages in Java 1.5 > SDK so the code may no longer optimized. > > -- > This message is automatically generated by JIRA. > - > You can reply to this email to add a comment to the issue online. > > --0016e6476a9cc85c190480fe694d Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi Malcolm,

Thanks for your input for this bug.

I understand the risk but I dont think this is the right s= olution since the more Java move to better concurrency support, sticking wi= th the "deprecated" class will make the framework to be sluggish.=

Removing this dependency on Doug's concurrency pack= age to Java EE concurrency package and supporting Java generics should make= the Click framework to be more faster and efficient.

I have used Spring 2.5 before with Java concurrent package before and = never see any problem.

- Henry

On Thu, Mar 4, 2010 at 4:11 AM, Malcolm Edgar (JIRA) <jira@apache.org>= wrote:

=C2=A0 =C2=A0 [ https://issues.apache.org/jira/browse/CLK-636?page=3Dcom.atlass= ian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Malcolm Edgar closed CLK-636.
-----------------------------

=C2=A0 =C2=A0Resolution: Won't Fix

I appreciate the though around this issue but risk to production applicatio= ns using various Spring version is too high for the reward of removing this= class.

regards Malcolm Edgar

> Replace EDU.oswego.cs.dl.util.concurrent.ConcurrentReaderHashMap with = java.util.concurrent.ConcurrentHashMap
> ----------------------------------------------------------------------= --------------------------------------
>
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Key: CLK-636 > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 URL: https:= //issues.apache.org/jira/browse/CLK-636
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Project: Click
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Issue Type: Improvement
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Components: core
> =C2=A0 =C2=A0Affects Versions: 2.2.0
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Reporter: Henry Saputra
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 Attachments: concurrentreader_patch.diff >
>
> Since Click required Java SDK 1.5 or later, we could leverage the java= .util.concurrent.ConcurrentHashMap class to replace EDU.oswego.cs.dl.util.c= oncurrent.ConcurrentReaderHashMap class so reducing the Click runtime depen= dency.
> In my opinion here are some good reasons why:
> 1. The ConcurrentHashMap class in Java SDK is more efficient since it = utilizes internal hash classes to support better granularity and concurrenc= y compare to simple syncrhonized on the instance like in DU.oswego.cs.dl.ut= il.concurrent.ConcurrentReaderHashMap.
> 2. Looking at the use case ConcurrentReaderHashMap in Click, it used t= o cache the OGNL expression (please correct me if I am wrong). This scenari= o does not need exclusive lock on update which is the intended/ preferred u= se case for ConcurrentReaderHashMap. If there is a miss on OGNL expression = on a name in the cache, it will cerate one and put it to the map if no othe= r thread has not. So it will still perform as well as or better locking ent= ire table. However, if we do need exclusive lock on update, we can simulate= ConcurrentReaderHashMap with ConcurrentHashMap by setting concurrencyLevel= to one.
> 3. The ConcurrentHashMap support generic which is part of task being d= one to move Click code to Java generics.
> 4. Looks like the EDU.oswego.cs.dl.util.concurrent.ConcurrentReaderHas= hMap class is created by Doug Lea before contributions to java.util.concurr= ent packages in Java 1.5 SDK so the code may no longer optimized.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


--0016e6476a9cc85c190480fe694d--