[concurrency-interest] Traversal and removing elements from ConcurrentskipListSet

Martin Buchholz martinrb at google.com
Tue May 16 21:02:46 EDT 2017


There's a new API for what you're trying to do - removeIf
(and probably there's work to be done on our part making it optimal)

On Tue, May 16, 2017 at 5:43 AM, Dileep Mandapam <dileep.mandapam at gmail.com>
wrote:

> Hi
>
> Environment details:-
> java version "1.8.0_131"
> Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
> Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)
>
>
>
>  Removing an element while traversal . Sometimes elements are not removing
> from concurrentskiplistset.
>
> for( Element e : concurrentskiplistsetcollection) {
>
>      if ( e is to be removed) {
>             concurrentskiplistset.remove(e);
>     }
>
> }
>
> My question is safe to use above to pattern to remove elements ?
> --
> Regards
> Dileep M
>
> _______________________________________________
> Concurrency-interest mailing list
> Concurrency-interest at cs.oswego.edu
> http://cs.oswego.edu/mailman/listinfo/concurrency-interest
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cs.oswego.edu/pipermail/concurrency-interest/attachments/20170516/747aa3b5/attachment.html>


More information about the Concurrency-interest mailing list