Java arrayblockingqueue, synchronousqueue

Source: Internet
Author: User

The blockingqueue interface defines a blocking FIFO queue. Each blockingqueue has a capacity, which causes blocking when the capacity is full and data is added to blockingqueue;When the capacity is empty, the element fetch operation will be blocked.

SynchronousqueuE: Yes.A blocking queue. Each put must wait for one take, and vice versa. The synchronization queue does not have any internal capacity or even the capacity of a queue. You cannot perform peek on the synchronization queue, because this element exists only when you try to obtain it. This element cannot exist unless another thread tries to remove it (using any method) you cannot add an element or iterate a queue because no element can be used for iteration.The queue header is the first queued thread element to be added to the queue. If no queued thread exists, no element is added and the header is null..

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.