LinkedTransferQueue

The TransferQueue interface is extending BlockingQueue and the only implementation of it in the JDK is LinkedTransferQueue. A TransferQueue comes handy when a thread wants to hand over some data to another thread and needs to be sure that some other thread takes the element. This TransferQueue has a method transfer that puts an element on the queue but does not return until some other thread removes (or polls) it. That way the producing thread can be sure that the object put on the queue is in the hands of another processing thread and does not wait in the queue. The method transfer also has a format tryTransfer in which you can specify some timeout value. If the method times out the element is not put into the queue.

..................Content has been hidden....................

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