设置并行流最大线程数
发表于|更新于
|浏览量:
做你自己,因为别人都有人做了。——王尔德
我们可以使用如下方式获取并行流线程数
如果我们需要更改,则可以设置系统属性:
1 | System.setProperty("java.util.concurrent.ForkJoinPool.common.parallelism", "8"); |
例如此处设置为8
则再次获取

可以看到是8个子线程+1个主线程,也就是9个线程
还可以使用ForkJoinPool.getCommonPoolParallelism()直接获取ForkJoinPool中允许设置的最大线程数
相关推荐
2020-07-14
Gitlab的安装
Gitlab安装1.安装相关依赖 1yum -y install policycoreutils openssh-server openssh-clients postfix 2.启动ssh服务&设置为开机启动 1systemctl enable sshd && sudo systemctl start sshd 3.设置postfix开机自启,并启动,postfix支持gitlab发信功能 1systemctl enable postfix && sudo systemctl start postfix 如果报这个错 1Job for postfix.service failed because the control process exited with error code. See "systemctl status postfix.service" and "journalctl -xe" for details. 可以采取以下解决方案 1234#修改 /etc/postfix/m...
2024-09-30
bean-searcher自动接收请求参数、多租户隔离、逻辑删除
今天尽你最大的努力去做好,明天你也许就能做得更好。——牛顿 文档地址如下: 其它玩法 | Bean Searcher Bean Searcher 的参数过滤器 ParamFilter,非常易于自定义,可以让我们用简单几行代码,就玩出其它 ORM 难以实现的花样。 自动接收请求参数1234567891011121314151617181920212223@Componentpublic class MyParamFilter implements ParamFilter { // 定义一个常量,作为一个开关,当启用时,则取消自动加载功能 public static final String IGNORE_REQUEST_PARAMS = "IGNORE_REQUEST_PARAMS"; @Override public <T> Map<String, Object> doFilter(BeanMeta<T> beanMeta, Map<String, Object> para...
2024-03-03
apache-tika从ppt-pdf-xls读取文本
你若要喜爱自己的价值,你就得给世界创造价值。——歌德 代码仓库: GitHub - apache/tika: The Apache Tika toolkit detects and extracts metadata and text from over a thousand different file types (such as PPT, XLS, and PDF). 官网: https://tika.apache.org/ 快速开始: Apache Tika – Getting Started with Apache Tika 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610...
2024-03-16
mybatis的@MappedTypes
“Given enough eyeballs, all bugs are shallow.” — Linus’s Law, Eric S. Raymond 看到com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler的源码 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778/* * Copyright (c) 2011-2023, baomidou (jobob@qq.com). * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * ...
2020-12-28
中文转拼音
时间最不偏私,给任何人都是二十四小时;时间也最偏私,给任何人都不是二十四小时。──赫胥黎 引入依赖 12345<dependency> <groupId>com.belerweb</groupId> <artifactId>pinyin4j</artifactId> <version>2.5.0</version></dependency> 编写代码 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172package com.ruben.utils;import net.sourceforge.pinyin4j.PinyinHelper;import net.sourceforge.pinyin4j.format.HanyuPinyinCaseT...
2023-12-17
spring-doc报错Unable to render this definition
心情愉快是肉体和精神的最佳卫生法。——乔治·桑 原因:自己修改了ByteArrayHttpMessageConverter的顺序。。。 解决方案: OpenAPI 3 Library for spring-boot 13.79. Why am i getting an error: Swagger UI unable to render definition, when overriding the default spring registered HttpMessageConverter?When overriding the default spring-boot registered HttpMessageConverter, you should have ByteArrayHttpMessageConverter registered as well to have proper springdoc-openapi support. 12converters.add(new ByteArrayHttpMessageConverter());converters...

阿超
我的名字叫阿超 年龄25岁 家在北京市 职业是软件开发 每天最晚也会在八点前回家 不抽烟 酒浅尝辄止 晚上十二点上床 保证睡足八个小时 睡前写一篇博客 再做二十分钟俯卧撑暖身 然后再睡觉 基本能熟睡到天亮 像婴儿一样不留下任何疲劳和压力 就这样迎来第二天的早晨 健康检查结果也显示我很正常 我想说明我是一个不论何时都追求内心平稳的人 不拘泥于胜负 不纠结于烦恼 不树立使我夜不能寐的敌人 这就是我在这社会的生活态度
Follow Me公告
This is my Blog