Giter Club home page Giter Club logo

Comments (18)

GoogleCodeExporter avatar GoogleCodeExporter commented on September 3, 2024
[deleted comment]

from jdbm2.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 3, 2024
[deleted comment]

from jdbm2.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 3, 2024
[deleted comment]

from jdbm2.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 3, 2024
[deleted comment]

from jdbm2.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 3, 2024
[deleted comment]

from jdbm2.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 3, 2024
[deleted comment]

from jdbm2.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 3, 2024
[deleted comment]

from jdbm2.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 3, 2024
[deleted comment]

from jdbm2.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 3, 2024
[deleted comment]

from jdbm2.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 3, 2024
[deleted comment]

from jdbm2.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 3, 2024
[deleted comment]

from jdbm2.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 3, 2024
Ok. Ignore my other comments. :)

The attached patch is an implementation of a caching record manager. It 
features fine-grained synchronisation: reads, writes, and deletes on individual 
 records do not block. Global operations (defrag, commit, rollback) block and 
take priority.

Caching is done via the soft reference/weak hash map method. An MRU queue can 
be used if the JVM is unnecessarily clearing SoftReferences.

Included is a JUnit stress test, which sparks up 200 threads for 20 seconds and 
hammers an instance of the cache. Included also is a GUI with a main() method 
allowing you to experiment with the locks.

The code is threadsafe and does not use the double-locking pattern, which is 
known to be faulty owing to bugs in the JVM specification. (yes, really). 

The patch creates a new class - CacheRecoprdManager3 - which is not integrated 
into the RecordManagerFactory as yet, and does not replace the existing 
CacheRecordManager.

Original comment by [email protected] on 14 Mar 2011 at 5:43

Attachments:

from jdbm2.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 3, 2024
Hi, 
sorry for very long delay (very busy in real life). 
I had quick look at patch, it looks ok. 
I granted you write access to SVN repository. Feel free to integrate this patch 
as optional Cache. There should be an parameter to switch this on. 

I will try to find time as soon as possible. 

Jan

Original comment by [email protected] on 17 Mar 2011 at 10:35

from jdbm2.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 3, 2024
No worries. May be able to get it done over the weekend.

Original comment by [email protected] on 17 Mar 2011 at 12:21

from jdbm2.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 3, 2024
Why not use LRU concurrent map available here - 
http://code.google.com/p/concurrentlinkedhashmap/#Features?

Or use what the "Master"/Doug Lea wrote - 
http://gee.cs.oswego.edu/dl/jsr166/dist/extra166ydocs/extra166y/ConcurrentRefere
nceHashMap.html

Original comment by [email protected] on 18 Mar 2011 at 1:55

from jdbm2.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 3, 2024
Ok, I have checked in the code as revision 67.
The ConcurrentReferenceHashMap and the other objects mentioned look good. But, 
I have already finished and it passes the tests, so there you go. 
I have made a few more changes, in particular - the exclusive/nonexclusive 
locker is broken out into a separate class. Perhaps it should be moved into a 
nice little googlecode project of its own.

Changes (as per the svn update comment) are: 

*Added CacheRecordManager3 and its helper classes
*Added Tests
*Plugged CacheRecordManager3 into Provider as the default soft cache
*Added some javadoc to RecordManagerOptions
*Corrected method name in TestIssues
*Altered ant build to point javadoc at the current SE6 location

I have altered the build file so that the generated javadoc will correctly link 
to the SE6 javadocs at oracle. However, I have not regenerated and checked in 
the javadoc in the project itself.

Original comment by [email protected] on 18 Mar 2011 at 4:57

from jdbm2.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 3, 2024
Hi,
this cache was not really faster than old one, so I reverted it back as default 
option. It is still in JDBM and can be use with 'soft3' parameter.

I guess basic problem with performance is overhead. For each entry inserted two 
new references has to be created. And new Long object instance has to be 
created with each lookup.

Original comment by [email protected] on 14 Apr 2011 at 6:51

from jdbm2.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 3, 2024

Original comment by [email protected] on 14 Apr 2011 at 6:52

  • Changed state: Fixed

from jdbm2.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.