1.

What Is Synchronous Queue In Java?

Answer»

SynchronousQueue is an implementation of the BlockingQueue interface. SynchronousQueue does not have any INTERNAL capacity, not even a capacity of one. In SynchronousQueue each INSERT operation must wait for a corresponding remove operation by another thread, and VICE versa.

If you PUT an element in SynchronousQueue using put() METHOD it will wait for another thread to receive it, you can't put any other element in the SynchronousQueue as it is blocked.

SynchronousQueue is an implementation of the BlockingQueue interface. SynchronousQueue does not have any internal capacity, not even a capacity of one. In SynchronousQueue each insert operation must wait for a corresponding remove operation by another thread, and vice versa.

If you put an element in SynchronousQueue using put() method it will wait for another thread to receive it, you can't put any other element in the SynchronousQueue as it is blocked.



Discussion

No Comment Found