[concurrency-interest] Unmodifiable Navigable{Set,Map} ?

Hanson Char hanson.char at gmail.com
Thu Mar 18 12:02:17 EDT 2010


In general, if one can ensure a TreeMap is not modified after initialization
(with a given data set), I would expect the subsequent read-only access to
it would have better performance (both in terms of memory footprint and
latency) as compared to the use of a ConcurrentSkipListMap (which is also
not modified after initialization with the same data set).

Is this a reasonable expectation ?

Thanks,
Hanson

On Wed, Mar 17, 2010 at 5:48 PM, Hanson Char <hanson.char at gmail.com> wrote:

> Actually TreeSet and TreeMap are the non-concurrent navigable Set/Map in
> the jdk.  Would be nice if there is a
> Collections.unmodifiableNavigable{Set,Map}(...).
>
> Or in the google-collections case, would be nice if there is an
> ImmutableNavigable{Set,Map}.
>
> Hanson
>
>
> On Wed, Mar 17, 2010 at 9:55 AM, Kevin Bourrillion <kevinb at google.com>wrote:
>
>> If you can make do with the older Sorted{Set,Map} interfaces, there are
>> array-based immutable implementations in google-collections 1.0.
>>
>>
>> http://google-collections.googlecode.com/svn/trunk/javadoc/com/google/common/collect/ImmutableSortedSet.html
>>
>> http://google-collections.googlecode.com/svn/trunk/javadoc/com/google/common/collect/ImmutableSortedMap.html
>>
>>
>>
>> On Wed, Mar 17, 2010 at 9:34 AM, Hanson Char <hanson.char at gmail.com>wrote:
>>
>>> Does it make sense to have a "non-concurrent" skip list set/map
>>> implementation and provide a Collections.unmodifiableNaviable{Set,Map}(...)
>>> method so clients can choose to operate on an immutable Navigable{Set,Map},
>>> which is (by definition) both thread-safe and presumably can be a more light
>>> weight implementation than the existing ConcurrentSkipList{Set,Map} ?  Is
>>> the current lack of such API's an accident or by intent ?
>>>
>>> Thanks,
>>> Hanson
>>>
>>> _______________________________________________
>>> Concurrency-interest mailing list
>>> Concurrency-interest at cs.oswego.edu
>>> http://cs.oswego.edu/mailman/listinfo/concurrency-interest
>>>
>>>
>>
>>
>> --
>> Kevin Bourrillion @ Google
>> internal:  http://goto/javalibraries
>> external: http://guava-libraries.googlecode.com
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cs.oswego.edu/pipermail/concurrency-interest/attachments/20100318/61a9eecd/attachment.html>


More information about the Concurrency-interest mailing list