I don't see any place in particular, though since there is a lot of locking in 
Solr, and a lot I don't fully understand, thought I'd ask.  I don't see it used 
much in projects, but it is a nice piece of work.  Yeah LinkedConcurrentHashMap 
would be nice, that could be done.  Is it needed for anything right now?

----- Original Message ----
From: Yonik Seeley <[EMAIL PROTECTED]>
To: solr-dev@lucene.apache.org; jason rutherglen <[EMAIL PROTECTED]>
Sent: Thursday, June 8, 2006 1:50:45 PM
Subject: Re: ReentrantReadWriteLock

On 6/8/06, jason rutherglen <[EMAIL PROTECTED]> wrote:
> Have the Solr team looked at using ReentrantReadWriteLock for things like 
> LRUCache and in other places where read write locks are used?

Not really... ReentrantReadWriteLocks beat normal synchronization when
there are many readers, fewer writers, and heavy contention for the
locks.

In the case of our LRUCache, there aren't any pure readers... It's
implemented with LinkedHashMap, and every lookup changes the ordering
of the entries.

ConcurrentHashMap is a cool class, but there is no
LinkedConcurrentHashMap.  If you want to develop one feel free :-)  In
profiling though, cache lookups aren't that significant.  Are you
seeing something that indicates otherwise?

-Yonik
http://incubator.apache.org/solr Solr, the open-source Lucene search server




Reply via email to