Java 阻塞队列 BlockingQueue 详解: put,add 和 offer 三个方法

编程知识 更新时间:2023-05-02 19:12:43

BlockingQueue

java.util.concurrent public interface BlockingQueue<E> extends Queue<E>

A Queue that additionally supports operations that wait for the queue to become non-empty when retrieving an element, and wait for space to become available in the queue when storing an element.

BlockingQueue methods come in four forms, with different ways of handling operations that cannot be satisfied immediately, but may be satisfied at some point in the future:

one throws an exception,

the second returns a special value (either null or false, depending on the operation),

the third blocks the current t

更多推荐

Java 阻塞队列 BlockingQueue 详解: put,add 和 offer 三个方法

本文发布于:2023-04-28 05:07:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/6d216bfd17d95f4666293e061ef55e14.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:队列   详解   方法   offer   Java

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!

  • 107798文章数
  • 27247阅读数
  • 0评论数