当前位置:网站首页>Prefer thread pool over multithreading
Prefer thread pool over multithreading
2022-07-21 02:21:00 【Learning MicroStation】
Preferred thread pool , Instead of multithreading
/**
* corePoolSize: The number of threads is maintained for a long time Number of core threads , Number of commonly used threads
* maximumPoolSize: The maximum number of threads , Maximum number of threads
* keepAliveTime: Thread duration exceeded :60s
* Queuing of tasks :ArrayBlockingQueue It's a blocking queue , An array based blocking queue : fifo , Bounded queues , Queues do not support empty elements
*/
private static ExecutorService executor = new ThreadPoolExecutor(10, 10,
60L, TimeUnit.SECONDS, new ArrayBlockingQueue(10));
//ex:2
private static ThreadFactory threadFactory = new ThreadFactoryBuilder().build();
private static ExecutorService executorService = new ThreadPoolExecutor(10, 10,
60L, TimeUnit.SECONDS, new ArrayBlockingQueue<Runnable>(10),
threadFactory, new ThreadPoolExecutor.AbortPolicy());
边栏推荐
- * 反射获取常用的三种方式: * Class c = Class.forName(“完整类名带包名“); * Class c = Object.getClass(); /
- Ppt concise
- Mindspire open source anniversary carnival, quantum machine learning and deep molecular simulation and other huge new features are coming!
- 一文速学-PySpark数据分析基础:PySpark基础功能及基础语法详解
- BOM浏览器对象模型(下篇)—— offset、client、scroll三大家族、插件及本地存储特性(案例:仿京东放大镜、模态框拖拽)
- 详解决策树与随机森林
- 推荐一个截图工具-Snipaste
- 目标检测的入门(截至2020)
- 自定义MVC增查
- 《教程》torchtext的应用
猜你喜欢
Solve gradient explosion and gradient disappearance
kvm虚拟化
Shengsi YiDianTong | deep learning analysis of classical convolutional neural network
647. 回文子串【双指针:两种对称情况-回文串】(字符串S中回文子串的个数)
Responsive dream weaving template lock cylinder website
kettle
目标检测的进阶-one stage
SQL Server 2008 R2 卸载失败
Machine learning notes: Elmo Bert
机器学习之集成学习(Ensemble Learning)
随机推荐
BN与LN的区别
机器学习笔记: ELMO BERT
Redefine analysis - release of eventbridge real-time event analysis platform
Use regular expressions to bypass
ResNet知识点补充
DP knapsack problem
Caffeine缓存增改查过期
Several common models of convolutional neural network CNN
Search insertion position of C language force deduction question 35. Classical Dichotomy
详解激活函数
See through the "flywheel effect" of household brands from the perspective of three winged birds
[special for training course] Introduction to storage API
1*1卷积核的作用
【Pytorch】Tensorboard用法:标量曲线图、直方图、模型结构图
使用Dos命令生成目录文件树
The difference between break, continue and return
Responsive dream weaving template lock cylinder website
MySQL metabase & Account Management & Engine
《教程》torchtext的应用
With the advent of 5g era, VR panoramic production is an industry worthy of entrepreneurship