To take Remi's line of thinking and extend it, what features of List
are you relying on? Read/write patterns aren't the only criteria
here.
Do you care about: Absolute position? Relative position? Multiple
inserts of the same values? Are you adding items only, or deleting as
well? Randomly, or head delete/tail insert? Do you scan the list for
collisions/existence tests, or just walk it to perform actions?
-Jason
On Tue, Jun 3, 2008 at 8:08 AM, Rémi Forax <
forax@...> wrote:
> Peter Veentjer a écrit :
>> The CopyOnWriteArrayList is a threadsafe list that is useful if the
>> number of reads is much larger than the number of writes. But what if
>> you have the requirement for a List where the number of writes is a
>> lot larger than the number of reads?
>>
> Making LinkedList a java.util.List was an error, by example
> LinkedList list = ...
> for(int i=0;i<list.size();i++)
> System.out.println(list.get(i));
> is quadratic.
>
> Java 1.5 introduces a new interface java.util.Queue,
> a queue is a list without access using index.
>
> One threadsafe queue is:
> ConcurrentLinkedQueue ?
>
>> And if there are no List alternatives, are there other collection
>> classes that are better suited for a high percentage of writes?
>>
> regards,
> Rémi
> _______________________________________________
> Concurrency-interest mailing list
>
Concurrency-interest@...
>
http://altair.cs.oswego.edu/mailman/listinfo/concurrency-interest>
--
- Jason
_______________________________________________
Concurrency-interest mailing list
Concurrency-interest@...
http://altair.cs.oswego.edu/mailman/listinfo/concurrency-interest