Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 6a28f02

Browse files
Update 并发容器之BlockingQueue.md
1 parent fdfc739 commit 6a28f02

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

‎19.并发容器之BlockingQueue/并发容器之BlockingQueue.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
BlockingQueue基本操作总结如下(此图来源于JAVA API文档):
1010

11-
![BlockingQueue基本操作.png](http://upload-images.jianshu.io/upload_images/2615789-19d06e0ba334fe52.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
11+
![BlockingQueue基本操作.png](https://github.com/fancycoderzf/Java-concurrency/blob/master/19.%E5%B9%B6%E5%8F%91%E5%AE%B9%E5%99%A8%E4%B9%8BBlockingQueue/BlockingQueue%E5%9F%BA%E6%9C%AC%E6%93%8D%E4%BD%9C.png)
1212

1313
BlockingQueue继承于Queue接口,因此,对数据元素的基本操作有:
1414

@@ -88,7 +88,7 @@ tryTransfer方法如果当前有消费者线程(调用take方法或者具有
8888
8989
LinkedBlockingDeque是基于链表数据结构的有界阻塞双端队列,如果在创建对象时为指定大小时,其默认大小为Integer.MAX_VALUE。与LinkedBlockingQueue相比,主要的不同点在于,LinkedBlockingDeque具有双端队列的特性。LinkedBlockingDeque基本操作如下图所示(来源于java文档)
9090

91-
![LinkedBlockingDeque的基本操作.png](http://upload-images.jianshu.io/upload_images/2615789-d51d940d30786e32.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/600)
91+
![LinkedBlockingDeque的基本操作.png](https://github.com/fancycoderzf/Java-concurrency/blob/master/19.%E5%B9%B6%E5%8F%91%E5%AE%B9%E5%99%A8%E4%B9%8BBlockingQueue/LinkedBlockingDeque%E7%9A%84%E5%9F%BA%E6%9C%AC%E6%93%8D%E4%BD%9C.png)
9292

9393

9494

@@ -97,7 +97,7 @@ LinkedBlockingDeque是基于链表数据结构的有界阻塞双端队列,如
9797
另外,LinkedBlockingDeque实现了BlockingDueue接口而LinkedBlockingQueue实现的是BlockingQueue,这两个接口的主要区别如下图所示(来源于java文档):
9898

9999

100-
![BlockingQueue和BlockingDeque的区别.png](http://upload-images.jianshu.io/upload_images/2615789-7316a2543b99caa2.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/600)
100+
![BlockingQueue和BlockingDeque的区别.png](https://github.com/fancycoderzf/Java-concurrency/blob/master/19.%E5%B9%B6%E5%8F%91%E5%AE%B9%E5%99%A8%E4%B9%8BBlockingQueue/BlockingQueue%E5%92%8CBlockingDeque%E7%9A%84%E5%8C%BA%E5%88%AB.png)
101101

102102
从上图可以看出,两个接口的功能是可以等价使用的,比如BlockingQueue的add方法和BlockingDeque的addLast方法的功能是一样的。
103103

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /