Class SynchronizedLinkedConcurrentQueue<T>

java.lang.Object
com.illumon.util.queue.SynchronizedLinkedConcurrentQueue<T>
All Implemented Interfaces:
ConcurrentQueue<T>

public class SynchronizedLinkedConcurrentQueue<T> extends Object implements ConcurrentQueue<T>
Unconstrained low-allocation queue, implemented via intrusive linked list. All access is synchronized.
  • Constructor Details

  • Method Details

    • enqueue

      public boolean enqueue(T new_value)
      Description copied from interface: ConcurrentQueue
      Returns false when the queue is full This method should never block (but it may spin for a finite amount of time)
      Specified by:
      enqueue in interface ConcurrentQueue<T>
    • enqueue

      public boolean enqueue(T new_value, long not_used)
      Description copied from interface: ConcurrentQueue
      Spins forever until the item can be enqueued. Calls yield() after the number of specified spins.
      Specified by:
      enqueue in interface ConcurrentQueue<T>
    • dequeue

      public T dequeue()
      Description copied from interface: ConcurrentQueue
      Returns null when the queue is empty This method should never block (but it may spin for a finite amount of time)
      Specified by:
      dequeue in interface ConcurrentQueue<T>
    • put

      public void put(T new_value)
      Description copied from interface: ConcurrentQueue
      Only return when enqueued. (Might spin continuously)
      Specified by:
      put in interface ConcurrentQueue<T>
    • take

      public T take()
      Description copied from interface: ConcurrentQueue
      Only return w/ a dequeued value. (Might spin continuously)
      Specified by:
      take in interface ConcurrentQueue<T>
    • peek

      public T peek()
      Description copied from interface: ConcurrentQueue
      Return the current next value, or null if the queue is empty.
      Specified by:
      peek in interface ConcurrentQueue<T>