Suitable replacement for LinkedHashSet in util.concurrent package

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Suitable replacement for LinkedHashSet in util.concurrent package

Tutika Chakravarthy
Hi,
Is there any Suitable replacement class for
LinkedHashSet in java.util.concurrent package.

I have seen javadocs for ConcurrentSkipListSet and
CopyOnWriteArraySet. But both of them don't maintain
the order of elements the way they are inserted into.

LinkedHashSet maintains insertion-order while
iterating.

I would like to know whether any other concurrent set
is avaible which behaves in a similar way.


Tutika

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com 
_______________________________________________
Concurrency-interest mailing list
[hidden email]
http://altair.cs.oswego.edu/mailman/listinfo/concurrency-interest
Reply | Threaded
Open this post in threaded view
|

Re: Suitable replacement for LinkedHashSet in util.concurrent package

Joshua Bloch-2
No such animal exists (yet).

      Josh

On 5/12/06, Tutika Chakravarthy <[hidden email]> wrote:

> Hi,
> Is there any Suitable replacement class for
> LinkedHashSet in java.util.concurrent package.
>
> I have seen javadocs for ConcurrentSkipListSet and
> CopyOnWriteArraySet. But both of them don't maintain
> the order of elements the way they are inserted into.
>
> LinkedHashSet maintains insertion-order while
> iterating.
>
> I would like to know whether any other concurrent set
> is avaible which behaves in a similar way.
>
>
> Tutika
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
> _______________________________________________
> Concurrency-interest mailing list
> [hidden email]
> http://altair.cs.oswego.edu/mailman/listinfo/concurrency-interest
>

_______________________________________________
Concurrency-interest mailing list
[hidden email]
http://altair.cs.oswego.edu/mailman/listinfo/concurrency-interest
Reply | Threaded
Open this post in threaded view
|

RE: Suitable replacement for LinkedHashSet inutil.concurrent package

David Holmes-3
In reply to this post by Tutika Chakravarthy
> Tutika Chakravarthy writes:
> I have seen javadocs for ConcurrentSkipListSet and
> CopyOnWriteArraySet. But both of them don't maintain
> the order of elements the way they are inserted into.

Why do you say CopyOnWriteArraySet doesn't maintain the order of insertion?
The docs don't say anything one way or another, but an implementation would
have to go out of its way to not return things in order.

Cheers,
David Holmes

_______________________________________________
Concurrency-interest mailing list
[hidden email]
http://altair.cs.oswego.edu/mailman/listinfo/concurrency-interest
Reply | Threaded
Open this post in threaded view
|

RE: Suitable replacement for LinkedHashSet inutil.concurrent package

Tutika Chakravarthy
> Why do you say CopyOnWriteArraySet doesn't maintain
> the order of insertion?
> The docs don't say anything one way or another, but
> an implementation would
> have to go out of its way to not return things in
> order.


I am sorry . I did not read it properly.Actually the
doc says that  CopyOnWriteArraySet is suitable when
read-only operations vastly outnumber mutative
operations. But I am looking for a set which can
handle both the operations equally well.


Tutika

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com 
_______________________________________________
Concurrency-interest mailing list
[hidden email]
http://altair.cs.oswego.edu/mailman/listinfo/concurrency-interest