You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Thomas Vandahl <tv...@apache.org> on 2016/12/19 19:03:11 UTC

[JCS] Fwd: [jira] [Commented] (JCS-119) replace synchronized blocks by java locks or concurrenhashmap

Hi folks,

what is legally required to use Bens code within JCS?
Your help is appreciated.

Bye, Thomas


-------- Forwarded Message --------
Subject: [jira] [Commented] (JCS-119) replace synchronized blocks by
java locks or concurrenhashmap
Date: Sun, 18 Dec 2016 20:01:01 +0000 (UTC)
From: Ben Manes (JIRA) <ji...@apache.org>
Reply-To: issues@commons.apache.org
To: issues@commons.apache.org


    [
https://issues.apache.org/jira/browse/JCS-119?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15759353#comment-15759353
]
Ben Manes commented on JCS-119:
-------------------------------

You are welcome to integrate the code, as it is under the Apache
License. The class is well documented and easy to follow once you
understand the design. Its been used quite heavily (Cassandra, Neo4j,
Groovy, Grails, etc) and portions were ported into Guava when developing
its cache. You can either shade, copy as is, or copy and prune.

> replace synchronized blocks by java locks or concurrenhashmap
> -------------------------------------------------------------
>
>                 Key: JCS-119
>                 URL: https://issues.apache.org/jira/browse/JCS-119
>             Project: Commons JCS
>          Issue Type: Improvement
>            Reporter: Romain Manni-Bucau
>            Assignee: Thomas Vandahl
>             Fix For: jcs-2.1
>
>
> A cache is typically used in a concurrent environment. Since Java 6 using a ReentrantLock is faster than synchronized so can be interesting to replace synchronized blocks by a lock.
> Places i'm thinking about:
> * CompositeCache
> * AbstractDoubleLinkedListMemoryCache
> * LHMLRUMemoryCache
> * DoubleLinkedList
> * LRUMap
> * SingleLinkedList
> * SortedPreferentialArray
> Some places where replacing a HashMap by a ConcurrentHashMap can allow to get rid of synchronized without needing a lock:
> * CacheEventQueue
> * AbstractDiskCache
> * CacheWatchRepairable
> There are other places but this is the main I saw.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [JCS] Fwd: [jira] [Commented] (JCS-119) replace synchronized blocks by java locks or concurrenhashmap

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Le 19 déc. 2016 21:40, "Thomas Vandahl" <tv...@apache.org> a écrit :

On 19.12.16 20:19, Romain Manni-Bucau wrote:
> If code is asf 2 licensed just fixing licens and notice files in the build
> (referencing the project)

It is ASF2 licensed code. I was planning to copy the file to the JCS
source (it's just one class!)
Still valid?


If notice files are updated think so + Ben said it was ok on jira so looks
good if no other ancestors for this code.



> Btw, do we have jcs figures showing the jvm structure is way slower - ie a
> bench in jcs and not of the raw structure?

There are a couple of test classes not run by default that execute
performance tests. You may want to check these out.


Will try next week. Overall idea is to not import anything until we
actually need ;).



Bye, Thomas


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org

Re: [JCS] Fwd: [jira] [Commented] (JCS-119) replace synchronized blocks by java locks or concurrenhashmap

Posted by Thomas Vandahl <tv...@apache.org>.
On 19.12.16 20:19, Romain Manni-Bucau wrote:
> If code is asf 2 licensed just fixing licens and notice files in the build
> (referencing the project)

It is ASF2 licensed code. I was planning to copy the file to the JCS
source (it's just one class!)
Still valid?

> Btw, do we have jcs figures showing the jvm structure is way slower - ie a
> bench in jcs and not of the raw structure?

There are a couple of test classes not run by default that execute
performance tests. You may want to check these out.

Bye, Thomas


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [JCS] Fwd: [jira] [Commented] (JCS-119) replace synchronized blocks by java locks or concurrenhashmap

Posted by Romain Manni-Bucau <rm...@gmail.com>.
If code is asf 2 licensed just fixing licens and notice files in the build
(referencing the project)

Btw, do we have jcs figures showing the jvm structure is way slower - ie a
bench in jcs and not of the raw structure?




Le 19 déc. 2016 20:03, "Thomas Vandahl" <tv...@apache.org> a écrit :

> Hi folks,
>
> what is legally required to use Bens code within JCS?
> Your help is appreciated.
>
> Bye, Thomas
>
>
> -------- Forwarded Message --------
> Subject: [jira] [Commented] (JCS-119) replace synchronized blocks by
> java locks or concurrenhashmap
> Date: Sun, 18 Dec 2016 20:01:01 +0000 (UTC)
> From: Ben Manes (JIRA) <ji...@apache.org>
> Reply-To: issues@commons.apache.org
> To: issues@commons.apache.org
>
>
>     [
> https://issues.apache.org/jira/browse/JCS-119?page=com.
> atlassian.jira.plugin.system.issuetabpanels:comment-
> tabpanel&focusedCommentId=15759353#comment-15759353
> ]
> Ben Manes commented on JCS-119:
> -------------------------------
>
> You are welcome to integrate the code, as it is under the Apache
> License. The class is well documented and easy to follow once you
> understand the design. Its been used quite heavily (Cassandra, Neo4j,
> Groovy, Grails, etc) and portions were ported into Guava when developing
> its cache. You can either shade, copy as is, or copy and prune.
>
> > replace synchronized blocks by java locks or concurrenhashmap
> > -------------------------------------------------------------
> >
> >                 Key: JCS-119
> >                 URL: https://issues.apache.org/jira/browse/JCS-119
> >             Project: Commons JCS
> >          Issue Type: Improvement
> >            Reporter: Romain Manni-Bucau
> >            Assignee: Thomas Vandahl
> >             Fix For: jcs-2.1
> >
> >
> > A cache is typically used in a concurrent environment. Since Java 6
> using a ReentrantLock is faster than synchronized so can be interesting to
> replace synchronized blocks by a lock.
> > Places i'm thinking about:
> > * CompositeCache
> > * AbstractDoubleLinkedListMemoryCache
> > * LHMLRUMemoryCache
> > * DoubleLinkedList
> > * LRUMap
> > * SingleLinkedList
> > * SortedPreferentialArray
> > Some places where replacing a HashMap by a ConcurrentHashMap can allow
> to get rid of synchronized without needing a lock:
> > * CacheEventQueue
> > * AbstractDiskCache
> > * CacheWatchRepairable
> > There are other places but this is the main I saw.
>
>
>
> --
> This message was sent by Atlassian JIRA
> (v6.3.4#6332)
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>