The use case requires me not to block any thread while retrieving or putting values into a List<V>. I have been looking at compare-and-swap algorithms that require you to implement a datastructure yourself. I would like to use an existing implementation of Collection such as an ArrayList or LinkedList and achieve a lock-free insertion and look up of elements. There is an option to have AtomicReferenceArray<E>. But I was wondering if there was a way to achieve this for a variable-sized list.
ConcurrentLinkedQueuewhich is lock free. If you want the full functionality of aListthen you will need to look at external libraries.