File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 8
8
9
9
BlockingQueue基本操作总结如下(此图来源于JAVA API文档):
10
10
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 )
12
12
13
13
BlockingQueue继承于Queue接口,因此,对数据元素的基本操作有:
14
14
@@ -88,7 +88,7 @@ tryTransfer方法如果当前有消费者线程(调用take方法或者具有
88
88
89
89
LinkedBlockingDeque是基于链表数据结构的有界阻塞双端队列,如果在创建对象时为指定大小时,其默认大小为Integer.MAX_VALUE。与LinkedBlockingQueue相比,主要的不同点在于,LinkedBlockingDeque具有双端队列的特性。LinkedBlockingDeque基本操作如下图所示(来源于java文档)
90
90
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 )
92
92
93
93
94
94
@@ -97,7 +97,7 @@ LinkedBlockingDeque是基于链表数据结构的有界阻塞双端队列,如
97
97
另外,LinkedBlockingDeque实现了BlockingDueue接口而LinkedBlockingQueue实现的是BlockingQueue,这两个接口的主要区别如下图所示(来源于java文档):
98
98
99
99
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 )
101
101
102
102
从上图可以看出,两个接口的功能是可以等价使用的,比如BlockingQueue的add方法和BlockingDeque的addLast方法的功能是一样的。
103
103
You can’t perform that action at this time.
0 commit comments