当前位置:网站首页>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
边栏推荐
- LLVM系列(1)- LLVM简介
- Detailed explanation of interprocess communication
- The DBSCAN function of FPC package in R language performs density clustering analysis on data, and the plot function visualizes the clustering graph
- 【TcaplusDB知识库】TcaplusDB单据受理-创建业务介绍
- 杰理之DAC输出方式设置【篇】
- JSP自定义标签
- Peak store app imitation station development play mode explanation source code sharing
- 力扣(LeetCode)177. 第N高的薪水(2022.06.26)
- AutoCAD - three pruning methods
- 千万不要错过,新媒体运营15个宝藏公众号分享
猜你喜欢
![[tcaplusdb knowledge base] Introduction to tcaplusdb tcaplusadmin tool](/img/ba/f865c99f3ea9e42c85b7e906f4f076.png)
[tcaplusdb knowledge base] Introduction to tcaplusdb tcaplusadmin tool

【TcaplusDB知识库】TcaplusDB常规单据介绍

Wechat applet realizes five-star evaluation

Prevent being rectified after 00? I. The company's recruitment requires that employees cannot sue the company

【TcaplusDB知识库】TcaplusDB单据受理-创建业务介绍

进程间通信详解

Wait, how do I use setmemorylimit?
![[tcapulusdb knowledge base] Introduction to tmonitor system upgrade](/img/04/b1194ca3340b23a4fb2091d1b2a44d.png)
[tcapulusdb knowledge base] Introduction to tmonitor system upgrade

Leetcode 729. My schedule I (awesome, solved)
![Jerry's DAC output mode setting [chapter]](/img/2e/62bc74e216ed941bd2a0a191db63f0.png)
Jerry's DAC output mode setting [chapter]
随机推荐
i. Construction of mx6ull C language environment
[tcapulusdb knowledge base] tcapulusdb system user group introduction
Matlab exercises - create 50 rows and 50 columns of all zero matrix, all 1 matrix, identity matrix, diagonal matrix, and output the 135 element of the matrix.
15+ urban road element segmentation application, this segmentation model is enough!
Code for structural design of proe/creo household appliances - electric frying pan
R语言fpc包的dbscan函数对数据进行密度聚类分析、plot函数可视化聚类图
Youboxun attended the openharmony technology day to create a new generation of secure payment terminals
从零开始搭建物联网系统
After Jerry's sleep, the regular wake-up system continues to run without resetting [chapter]
政策关注 | 加快构建数据基础制度,维护国家数据安全
Don't miss it. New media operates 15 treasure official account to share
The R language uses the DOTPLOT function of epidisplay package to visualize the frequency of data points in different intervals in the form of point graph, specifies the grouping parameters with the b
L'utilisation de C language 0 length Array
"24 of the 29 students in the class successfully went to graduate school" rushed to the hot search! Where are the remaining five?
优博讯出席OpenHarmony技术日,全新打造下一代安全支付终端
建木持续集成平台v2.5.0发布
杰理之DAC输出方式设置【篇】
【TcaplusDB知识库】TcaplusDB数据导入介绍
[tcapulusdb knowledge base] tcapulusdb OMS business personnel permission introduction
Interview shock 60: what will cause MySQL index invalidation?