36

PriorityBlockingQueue 1.8 源码解析-pjcdpainful

 4 years ago
source link: https://blog.51cto.com/14220760/2414954
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
[TOC]PriorityBlockingQueue1.8源码解析一,简介PriorityBlockingQueue是一个支持优先级的×××阻塞队列,数据结构采用的是最小堆是通过一个数组实现的,队列默认采用自然排序的升序排序,如果需要自定义排序,需要在构造队列时指定Comparetor比较器,队列也是使用ReentrantLock锁来实现的同步机制。二,UML图三,基本成员//数组的最大容量2^31

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK