Lock-Free Concurrent Linked List in Java

ptikobj picture ptikobj · Jan 18, 2011 · Viewed 39.6k times · Source

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?

Answer

bestsss picture bestsss · Jan 18, 2011

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.