当前位置:网站首页>BlockingQueue, synchronousqueue, arrayblockingqueue, reentrantlock, semaphore, fair and unfair
BlockingQueue, synchronousqueue, arrayblockingqueue, reentrantlock, semaphore, fair and unfair
2022-06-10 08:56:00 【Wind chime peak】
BlockingQueue Yes ReentrantLock Of the two Condition. A concern is not empty ,put If it is not empty, it will execute signal, You can go on take,take If time is empty , Will execute await. One cares whether it is full ,take If you are dissatisfied, you will execute signal, You can go on put,put If the time is full , Will execute signal.
SynchronousQueue By internal queues (TransferQueue, Corresponding to the fair strategy ) Or stack (TransferStack, Corresponding to unfair strategies ) Storage elements , The default is unfair policy , and ArrayBlockingQueue By an internal array of objects ,LinkedBlockingQueue Rely on the internal two-way linked list ,Node There is prev and next.
put after LockSupport.park,take after LockSupport.unpark. perhaps take after LockSupport.park, perhaps put after LockSupport.unpark.
SynchronousQueue May refer to :https://www.jianshu.com/p/fce6fbc155fa
ArrayBlockingQueue Default is not fair , Fairness and unfairness are reflected in ReentrantLock Is it fair or unfair .
ReentrantLock The fairness of 、 The unfairness lies in whether to rob the lock when there are nodes in the queue , Fair locks do not rob , Guarantee first come first served , Unfair will try to acquire the lock .
Semaphore The fairness of 、 Unfairness lies in acquire Whether you care about the nodes in the queue , In a fair case, a node in the queue will be suspended directly , Unfair will try to make AQS Of state-1.
边栏推荐
- MMSegmention系列之三(基本的网络架构和预训练模型)
- Task06: Autumn move script a
- Exemple de référence AWS IOT de lexine pour esp32 - C3
- Video | Le Xin R & D theory
- js通过身份证号获取出生年月日,性别,年龄
- win11安装texlive 2021版本
- 数字藏品平台又传“跑路” :安全性遭疑,严监管在途
- LeetCode琅琊榜第二十层-二进制求和
- Ifstream seekg() read() text operation
- From zero to one, one-stop solution to MySQL under linux environment (download)
猜你喜欢

vtk学习之PipelineExecute管线的执行过程

MMSegmention系列之六(训练技巧)

软件测试|从HR那里冒险套路过来的面试经验,绝对加分项

Why can't Google search page infinite?

Level 18 of leetcode Langya list - sum of two numbers (lookup table method)

Win11 install texlive version 2021

Texstudio how to compile and run tex files based on markdown macro package

One paper second kill all permutation and combination subsets problem

vtk学习之引用计数与智能指针

Lexin's latest support for zephyr
随机推荐
Credit card customer churn forecast
js通过身份证号获取出生年月日,性别,年龄
matlab报错问题汇总
Mmsegment Series III (basic network architecture and pre training model)
R语言caTools包进行数据划分、scale函数进行数据缩放、class包的knn函数构建K近邻分类器、比较不同K值超参数下模型准确率和误分类率(miss classification error)
wechat_ Configuration of wechat applet subcontracting
顶流编辑器 Atom,将于 12 月 15 日退出历史舞台
文件如上图所示,怎么用navicat打开一个数据库文件
网页免费 字体库
Pinctrl subsystem and GPIO subsystem
Simple operation and debugging of GPIO in Qualcomm platform
Auto. JS Pro development environment configuration
LeetCode琅琊榜第二十一层-只出现一次的数字
Vscode markdown all in One Keyboard Shortcut
wechat_微信小程序分包的配置
MMSegmention系列之六(训练技巧)
Latex基本语法备注
Mmsegment SERIES V (custom model)
vtk学习之PipelineExecute管线的执行过程
乐鑫 ESP RainMaker 加速企业智能转型,私有云方案助力客户打造自有品牌