Thread-safe transfer queue

Java provides a thread-safe unbounded transfer queue based on linked nodes via LinkedTransferQueue.

This is a FIFO queue in which the head is the element that has been on the queue the longest time for some producer. The tail of the queue is the element that has been on the queue the shortest time for some producer.

One way to create this kind of queue is as follows:

TransferQueue<String> queue = new LinkedTransferQueue<>();
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset