SynchronousQueue is a blocking queue in which each PUT must wait for a take and vice versa. Synchronous queues do not have any internal capacity, or even the capacity of a queue. Peek cannot be done on synchronous queues because the element exists only when an attempt is made to retrieve it; You can’t add elements unless another thread tries to remove them; The queue cannot be iterated because there are no elements in it for iteration. The head of the queue is the first queued thread element that is attempted to be added to the queue; If there are no queued threads, no element is added and the header is null. For other Collection methods (such as contains), SynchronousQueue is an empty Collection. This queue does not allow NULL elements. The synchronization queue is similar to the Rendezvous channel used in CSP and Ada. It is well suited for transitive design, in which an object running in one thread must synchronize with the object in order to pass some information, events, or tasks to an object running in another thread. This class supports an optional fair sorting strategy for waiting producer and consumer threads. This sort is not guaranteed by default. However, a queue constructed with a fair setting of true guarantees that threads will access in FIFO order. Fairness generally reduces throughput, but it reduces variability and avoids underservice. Public Constructors SynchronousQueue() Creates a SynchronousQueue with nonfair access policy. SynchronousQueue(boolean fair) Creates a SynchronousQueue with the specified fairness policy. Note 1: It is a blocking queue in which each PUT must wait for a take and vice versa. Synchronous queues do not have any internal capacity, or even the capacity of a queue. Note 2: It is thread-safe and blocks. Note 3: Null elements are not allowed. Note 4: The fair sorting strategy is between the threads calling put or take. Fair sorting policies you can look up fair policies in the ArrayBlockingQueue. Note 5: The SynchronousQueue method is interesting: * iterator() always returns empty because there is nothing in it. * peek() always returns null. * Put () puts an element in the queue and waits until another thread comes in and removes it. * Offer () returns immediately after placing an element in the queue. If the element happens to be taken by another thread, the offer method returns true. Otherwise return false. * Offer (2000, timeunit.seconds) puts an element in a queue and waits a specified amount of time before returning it, using the same logic as offer(). * Take () and remove the element from the queue. He will wait until he can get something. Poll () removes the element from the queue. This method will only fetch something if another thread happens to be putting or offering data to the queue. Otherwise, null is returned immediately. Poll (2000, timeunit.seconds) Poll (2000, timeunit.seconds) Wait for a specified amount of time to remove and remove elements from the queue. * isEmpty() is always true. * remainingCapacity() is always 0. * Remove () and removeAll() are always false.