当前位置:网站首页>Basic usage and principle of fork/join framework
Basic usage and principle of fork/join framework
2022-06-27 11:56:00 【Alien meow】
ForkJoin Thread pool framework review
ForkJoin A framework is actually a thread pool ExecutorService The implementation of the , Steal... Through work (work-stealing) Algorithm , Get unfinished tasks from other threads to execute .
Can make full use of the machine's multiprocessor advantages , Use idle threads to quickly complete a large task that can be divided into small tasks in parallel , Similar to divide and conquer algorithm .
ForkJoin The goal of , Is to use all available processing power to improve program response and performance . This article will introduce ForkJoin frame , Source analysis .
ForkJoinPool Core class implementation
ForkJoin The core of the framework is ForkJoinPool class , be based on AbstractExecutorService Expand .
ForkJoinPool A queue array is maintained in WorkQueue[], Every WorkQueue Maintain a ForkJoinTask Array and current worker thread .
ForkJoinPool Work theft is realized (work-stealing) Algorithm and execute ForkJoinTask.
ForkJoinPool, All threads and WorkQueue share , For work theft 、 Task status and work status are synchronized .
Introduction to core attributes
ADD_WORKER: 100000000000000000000000000000000000000000000000 -> 1000 0000 0000 0000, To cooperate with ctl Use... When controlling the number of threads
ctl: control ForkJoinPool Number of threads created ,(ctl & ADD_WORKER) != 0L Create thread when , That is to say ctl Of the 16 Not for 0 when , You can continue to create threads
defaultForkJoinWorkerThreadFactory: Default thread factory
边栏推荐
- AUTOCAD——三种修剪方式
- Prevent being rectified after 00? I. The company's recruitment requires that employees cannot sue the company
- [tcapulusdb knowledge base] tcapulusdb business data backup introduction
- R语言使用glm函数构建泊松对数线性回归模型处理三维列联表数据构建饱和模型、使用step函数基于AIC指标实现逐步回归筛选最佳模型、解读分析模型
- Youboxun attended the openharmony technology day to create a new generation of secure payment terminals
- Summary of qstype class usage (II)
- The GLM function of R language is used to build a binary logistic regression model (the family parameter is binomial), and the AIC function is used to compare the AIC values of the two models (simple
- Heap heap sort TOPK
- 【TcaplusDB知识库】TcaplusDB单据受理-创建业务介绍
- 【值得收藏】Centos7 安装mysql完整操作命令
猜你喜欢
![[tcapulusdb knowledge base] tcapulusdb doc acceptance - Introduction to creating game area](/img/b7/2358e8cf1cdaeaba77e52d04cc74d4.png)
[tcapulusdb knowledge base] tcapulusdb doc acceptance - Introduction to creating game area

QStyle类用法总结(二)

【值得收藏】Centos7 安装mysql完整操作命令

1. Mx6ull startup mode

Mqtt protocol stack principle and interaction flow chart

Drive to APasS!使用明道云管理F1赛事

QStyle实现自绘界面项目实战(一)

Build the Internet of things system from scratch

matlab习题 —— 创建 50 行 50 列全零矩阵、全 1 矩阵、单位矩阵、对角矩阵,输出矩阵第135号元素。

JSP自定义标签
随机推荐
机器学习系统在生产中的挑战
R语言使用epiDisplay包的followup.plot函数可视化多个ID(病例)监测指标的纵向随访图、使用stress.labels参数在可视化图像中为强调线添加标签信息
2022ciscn central China Web
【TcaplusDB知识库】TcaplusDB数据构造介绍
Jerry's DAC output mode setting [chapter]
[tcapulusdb knowledge base] Introduction to tcapulusdb table data caching
Qstype implementation of self drawing interface project practice (I)
最大路径和问题(摘樱桃问题)
I.MX6ULL启动方式
Peak store app imitation station development play mode explanation source code sharing
杰理之无缝循环播放【篇】
政策关注 | 加快构建数据基础制度,维护国家数据安全
Detailed explanation of interprocess communication
Microsoft cloud technology overview
Prevent being rectified after 00? I. The company's recruitment requires that employees cannot sue the company
What is the TCP 3-time handshake process?
0 basic understanding of how e-commerce systems connect with payment channels
AutoCAD - three pruning methods
JSP custom tag
Drive to APasS! Use Mingdao cloud to manage F1 events