I want concurrently do the next things:
Question: which concurrent collection will give me the best performance.
EDIT: (how happens removing from the middle)
I'll iterate the whole collection, find begIndex
and remove n
next elements beggining from begIndex
.
The datastructure you describe sounds totally like a queue. Java has the ConcurrentLinkedQueue for that.
More on that on
http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ConcurrentLinkedQueue.html
It states there that
This implementation employs an efficient "wait-free" algorithm based on one described in Simple, Fast, and Practical Non-Blocking and Blocking Concurrent Queue Algorithms by Maged M. Michael and Michael L. Scott.