Является ли эта (без блокировки) реализация очереди поточно-ориентированной?

Я пытаюсь создать реализацию Java без очереди, в основном для личного обучения. Очередь должна быть общей, допускающей одновременное использование любого количества читателей и / или писателей.

Не могли бы вы рассмотреть его и предложить какие-либо улучшения / проблемы, которые вы найдете?

Спасибо.

import java.util.concurrent.atomic.AtomicReference;

public class LockFreeQueue {
    private static class Node {
        E value;
        volatile Node next;

        Node(E value) {
            this.value = value;
        }
    }

    private AtomicReference head, tail;

    public LockFreeQueue() {
        // have both head and tail point to a dummy node
        Node dummyNode = new Node(null);
        head = new AtomicReference(dummyNode);
        tail = new AtomicReference(dummyNode);
    }

    /**
     * Puts an object at the end of the queue.
     */
    public void putObject(T value) {
        Node newNode = new Node(value);
        Node prevTailNode = tail.getAndSet(newNode);
        prevTailNode.next = newNode;
    }

    /**
     * Gets an object from the beginning of the queue. The object is removed
     * from the queue. If there are no objects in the queue, returns null.
     */
    public T getObject() {
        Node headNode, valueNode;

        // move head node to the next node using atomic semantics
        // as long as next node is not null
        do {
            headNode = head.get();
            valueNode = headNode.next;
            // try until the whole loop executes pseudo-atomically
            // (i.e. unaffected by modifications done by other threads)
        } while (valueNode != null && !head.compareAndSet(headNode, valueNode));

        T value = (valueNode != null ? valueNode.value : null);

        // release the value pointed to by head, keeping the head node dummy
        if (valueNode != null)
            valueNode.value = null;

        return value;
}

Ответы на вопрос(4)

Ваш ответ на вопрос