当前位置:网站首页>Comparative analysis of arrayblockingqueue and linkedblockingqueue
Comparative analysis of arrayblockingqueue and linkedblockingqueue
2022-06-24 19:32:00 【Jade label】
ArrayBlockingQueue: Based on the array implementation , Use a lock ,2 A semaphore , An array , One data release index, One fetches data index, When storing data , Each time the data is released, the blocked fetching thread will be notified , Each time the data is fetched, the blocked thread will be notified , Please note that : Take and put are mutually exclusive .
LinkedBlockingQueue: Based on single linked list , Use 2 The lock , Each lock has a semaphore , One node Linked list , A point to put data node node last, A point to get data node node head, When storing data , Every time the data is released , If the container is not full , Will continue to notify the drop thread , Put the data , Until the container is full , Every time data is retrieved , After getting the data , If the container still has data , Will notify the fetching thread to continue fetching data , Until the data in the container is empty , Please note that : Fetch and fetch are mutually exclusive , Put and put are mutually exclusive , Taking and placing can be done at the same time .
stay JDK1.8 Next ,LinkedBlockingQueue Better performance than the ArrayBlockingQueue
边栏推荐
- 技术实现 | Apache Doris 冷热数据存储(一)
- Volcano becomes spark default batch scheduler
- At present, only CDC monitors Mysql to get the data of new columns. Sqlserver can't, can it
- R language 4.1.0 software installation package and installation tutorial
- 应用实践 | 海量数据,秒级分析!Flink+Doris 构建实时数仓方案
- 模块五
- 网络安全审查办公室对知网启动网络安全审查
- [leetcode] rotation series (array, matrix, linked list, function, string)
- Server lease error in Hong Kong may lead to serious consequences
- AI时代生物隐私如何保护?马德里自治大学最新《生物特征识别中的隐私增强技术》综述,全面详述生物隐私增强技术
猜你喜欢

High dimension low code: component rendering sub component

Unity移动端游戏性能优化简谱之 以引擎模块为划分的CPU耗时调优

技术实现 | Apache Doris 冷热数据存储(一)

System design idea of time traceability

R for Data Science (note) -- data transformation (select basic use)

试驾 Citus 11.0 beta(官方博客)

Saltstack state state file configuration instance

Zadig + cave Iast: let safety dissolve in continuous delivery

Huawei machine learning service speech recognition function enables applications to paint "sound" and color

UART communication (STM32F103 library function)
随机推荐
Understanding openstack network
Mq-2 smoke concentration sensor (STM32F103)
技术实现 | Apache Doris 冷热数据存储(一)
Application scenarios of channel of go question bank · 11
Sr-gnn shift robot gnns: overlapping the limitations of localized graph training data
Why are life science enterprises on the cloud in succession?
Several ways of connecting upper computer and MES
What type of datetime in the CDC SQL table should be replaced
Steering gear control (stm32f103c8t6)
Technology implementation | Apache Doris cold and hot data storage (I)
Programmers spend most of their time not writing code, but...
Freeswitch uses origin to dialplan
Example analysis of corrplot related heat map beautification in R language
Zadig + cave Iast: let safety dissolve in continuous delivery
Saltstack state state file configuration instance
Xiaobai, let me ask you guys, is MySQL binlog extracted by CDC in strict order
An accident caused by a MySQL misoperation cannot be withstood by High Availability!
The sharp sword of API management -- eolink
A detailed explanation of the implementation principle of go Distributed Link Tracking
小滴课堂海量数据处理商用短链平台大课