当前位置:网站首页>Common sense of thread pool
Common sense of thread pool
2022-04-23 06:09:00 【commonBean】
Threads do not distinguish between core and non core , The core is not created first , Beyond the number of core threads, non core threads are created , Which threads are retained eventually , Completely random .
allowCoreThreadTimeout You can set the core thread to recyclable , But it's not recommended .
When to recycle non core threads ?
see getTask() Method :
When the number of frontline threads is greater than the number of core threads , When the work queue is empty , stay getTask() Call in method compareAndDecrementWorkerCount Method , Reduce the number of threads by one .getTask Method returns null after ,runWorker Method internal while The loop ends , perform processWorkerExit Methods from workers(HashSet) variable remove The worker.
maxPoolSize Is it the number of non core threads or the maximum total number of threads ?
Is the maximum number of threads , Number of non core threads =maxPoolSize-corePoolSize
版权声明
本文为[commonBean]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204220533053211.html
边栏推荐
- 图解numpy数组矩阵
- Pytorch learning record (III): structure of neural network + using sequential and module to define the model
- Viewer: introduce MySQL date function
- Pytorch learning record (XII): learning rate attenuation + regularization
- 去噪论文阅读——[RIDNet, ICCV19]Real Image Denoising with Feature Attention
- Reading of denoising paper - [ridnet, iccv19] real image denoising with feature attention
- Understanding and use of tp50, tp90 and tp99
- CONDA virtual environment management (create, delete, clone, rename, export and import)
- Explain of MySQL optimization
- Pyqy5 learning (4): qabstractbutton + qradiobutton + qcheckbox
猜你喜欢
The bottom implementation principle of thread - static agent mode
去噪论文——[Noise2Void,CVPR19]Noise2Void-Learning Denoising from Single Noisy Images
Generate excel template (drop-down selection, multi-level linkage)
Pytoch -- data loading and processing
数字图像处理基础(冈萨雷斯)一
Linear algebra Chapter 1 - determinant
Pyqy5 learning (4): qabstractbutton + qradiobutton + qcheckbox
Pytorch learning record (V): back propagation + gradient based optimizer (SGD, adagrad, rmsporp, Adam)
PyTorch笔记——实现线性回归完整代码&手动或自动计算梯度代码对比
container
随机推荐
Solve the error: importerror: iprogress not found Please update jupyter and ipywidgets
Rsync for file server backup
常用编程记录——parser = argparse.ArgumentParser()
Latex quick start
The user name and password of users in the domain accessing the samba server outside the domain are wrong
Pytorch Learning record (XIII): Recurrent Neural Network
IO multiplexing of 09 redis
Opensips (1) -- detailed process of installing opensips
Automatic control (Han min version)
Pyqt5 learning (I): Layout Management + signal and slot association + menu bar and toolbar + packaging resource package
線性代數第一章-行列式
Traitement des séquelles du flux de Tensor - exemple simple d'enregistrement de torche. Utils. Données. Dataset. Problème de dimension de l'image lors de la réécriture de l'ensemble de données
Framework analysis 1 Introduction to system architecture
String notes
Pytorch学习记录(四):参数初始化
Pyqy5 learning (III): qlineedit + qtextedit
List segmentation best practices
7.Domino piling
Remedy after postfix becomes a spam transit station
Best practices for MySQL storage time