当前位置:网站首页>Thrift threadmanager and three monitors
Thrift threadmanager and three monitors
2022-07-03 13:49:00 【yolo_ yyh】
Catalog
One 、ThreadManager
effect : Thread pool management class , Create a thread with a thread factory
characteristic : Threads will not be created or destroyed , Instead, save the number of idle threads variable 、 Active threads variable ;
Maintain a task (task) queue , And balance the response and waiting time of the service , Notify the thread pool policy object (PoolPolicy object ) Relevant information , from PoolPolicy object Determine pool sizing , The advantage of this is that the strategy can be decoupled .
Two 、 Three Monitor
(1) monitor_
To coordinate task Fast execution , Join the slow situation , When one worker Finish one task, It will start from tasks Get another one in , If not , Just block ; When new task Add to tasks perhaps worker When cleaned ,monitor_ Wake up again .
(2) workerMonitor_
Every worker Run out task Will be added to deadWorkers_ Inside ,addWorker and removeWorker Will not change workCount_, It will only change workMaxCount_, Only when run When it's time to change manager_ Of workerCount_, Synchronization is by workerMonitor_ be responsible for .
(3) maxMonitor_
Used to monitor waiting task number , When manager_ call add add to task when , If the maximum has been exceeded , Will wait , Wait until call worker Of run Method , Remove... From the task queue task after , When the task queue length is less than the maximum , Wake up again .
边栏推荐
- The network card fails to start after the cold migration of the server hard disk
- User and group command exercises
- Spark实战1:单节点本地模式搭建Spark运行环境
- CVPR 2022 | 美团技术团队精选6篇优秀论文解读
- KEIL5出现中文字体乱码的解决方法
- Leetcode-1175.Prime Arrangements
- 又一个行业被中国芯片打破空白,难怪美国模拟芯片龙头降价抛售了
- Flutter动态化 | Fair 2.5.0 新版本特性
- Heap structure and heap sort heapify
- JSON serialization case summary
猜你喜欢

MySQL functions and related cases and exercises

研发团队资源成本优化实践

Comprehensively develop the main channel of digital economy and digital group, and actively promote the utonmos digital Tibet market

太阳底下无新事,元宇宙能否更上层楼?

This math book, which has been written by senior ml researchers for 7 years, is available in free electronic version

Halcon combined with C # to detect surface defects -- Halcon routine autobahn

Mycms we media mall v3.4.1 release, user manual update

SQL Injection (POST/Select)

物联网毕设 --(STM32f407连接云平台检测数据)
[email protected] chianxin: Perspective of Russian Ukrainian cyber war - Security confrontation and sanctions g"/>Start signing up CCF C ³- [email protected] chianxin: Perspective of Russian Ukrainian cyber war - Security confrontation and sanctions g
随机推荐
Complete DNN deep neural network CNN training with tensorflow to complete image recognition cases
MySQL installation, uninstallation, initial password setting and general commands of Linux
掌握Cypress命令行选项,是真正掌握Cypress的基础
MySQL functions and related cases and exercises
CVPR 2022 | interpretation of 6 excellent papers selected by meituan technical team
SQL Injection (GET/Select)
Static linked list (subscript of array instead of pointer)
Field problems in MySQL
[understanding by chance-37]: the structure of human sensory system determines that human beings are self-centered
使用vscode查看Hex或UTF-8编码
[556. Next larger element III]
Unable to stop it, domestic chips have made another breakthrough, and some links have reached 4nm
The principle of human voice transformer
SQL Injection (POST/Select)
Halcon combined with C # to detect surface defects -- Halcon routine autobahn
Libuv Library - Design Overview (Chinese version)
SVN添加文件时的错误处理:…\conf\svnserve.conf:12: Option expected
NFT new opportunity, multimedia NFT aggregation platform okaleido will be launched soon
Leetcode-1175. Prime Arrangements
Kivy tutorial how to load kV file design interface by string (tutorial includes source code)