"Conor MacNeill" <[EMAIL PROTECTED]> writes:

> Just an observation - The BufferCache doesn't seem very LRU to me since it
> doesn't do anything when an element is accessed. Have I missed something?

No Conor, I think it is me who missed something.  ;)
Now fixed (though I am a little concerned about all the calls to
LinkedList's remove() method that my change introduced).

> On a separate note, one feature I have added in the past to LRU caches is
> to allow a lifetime to be associated with an entry. If an entry is accessed
> after its lifetime has been exceeded, it is purged and it is not considered
> to be in the collection. Also, if the cache fills up, expired elements are
> purged first. It is part of my "nothing is forever" philosophy when
> caching.

I like it.  The objects that I'm currently caching can actually live
forever, but I see the usefullness of expiration.  Currently, we do
explicit cache invalidation rather than using timeouts (this is a
little tricky when we have a cluster of JVMs, however).

> ----- Original Message -----
> From: "Daniel Rall" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, May 18, 2001 9:59 AM
> Subject: [Collections] Turbine's BufferCache and SequencedHashtable
> 
> 
> > What would people think about moving Turbine's LRU algorithm
> > implementation into the Commons Collections?
> >
> >
> <http://jakarta.apache.org/cvsweb/index.cgi/jakarta-turbine/src/java/org/ap
> ache/turbine/util/BufferCache.java?rev=1.2&content-type=text/vnd.viewcvs-ma
> rkup>
> >
> >
> <http://jakarta.apache.org/cvsweb/index.cgi/jakarta-turbine/src/java/org/ap
> ache/turbine/util/SequencedHashtable.java?rev=1.3&content-type=text/vnd.vie
> wcvs-markup>

Reply via email to