问题
I would like to use a Linked List like the one described in this paper. However, I didn't find any Java implementation in the web.
If no java implementation of the above mentioned Linked List exists, I think, I would use the java.util.concurrent.ConcurrentLinkedQueue<E>. Is this a good choice (it is not really a linked list)?
If it's not a good choice, does anyone know of a reliable concurrent (thread-safe) wait-free(lock-free) Linked List implementation in Java?
回答1:
ConcurrentLinkedQueue is a superb lock free queue and does what a concurrent single linked list can do. A small warning: if you dont use poll or peek and only iterator() (+.remove()) it will leak memory.
It's an outstanding Queue.
来源:https://stackoverflow.com/questions/4724995/lock-free-concurrent-linked-list-in-java