01 2020 档案

等待所有线程都执行完毕 停止线程
摘要:int taskcount=futurelist.size(); //获取所有已提交的线程 int done=0;//已完成 while(done<taskcount){ done=0 for(Futrre(T) t:List){ //拿到所有的返回值futre isDone(t){ done++; 阅读全文

posted @ 2020-01-19 21:50 潮流教父孙笑川 编辑

线程池创建问题 饱和策略
摘要:传统的ExecutorService es = Executors.newFixedThreadPool(线程数量); FixedThreadPool : 该方法返回一个固定线程数量的线程池。该线程池中的线程数量始终不变。当有一个新的任务提交时,线程池中若有空闲线程,则立即执行。若没有,则新的任务会 阅读全文

posted @ 2020-01-19 21:43 潮流教父孙笑川 编辑

Theep.sleep(),单位是毫秒,当前现场停止指定时间后自动运行
摘要:Theep.sleep(), 单位毫秒 阅读全文

posted @ 2020-01-19 21:26 潮流教父孙笑川 编辑

AtomicInteger 线程安全的原子操作类 ConcurrentHashMap线程安全的hashMap LinkedHashMap保证顺序输出的Map
摘要:AtomicInteger count = new AtomicInteger(0) count.incrementAndGet(); /** * Atomically increments by one the current value. * * @return the updated valu 阅读全文

posted @ 2020-01-19 21:24 潮流教父孙笑川 编辑

List判断非空
摘要:不要再用size==0来判断 CollectionUtil.isEmpty(); 可判断null和size为0 import org.springframework.util.CollectionUtils; 例1: 判断集合是否为空: CollectionUtils.isEmpty(null): 阅读全文

posted @ 2020-01-19 21:19 潮流教父孙笑川 编辑

xml中需要转义的字体
摘要:下面是五个在XML文档中预定义好的实体: &lt; < 小于号 &gt; > 大于号 &amp; & 和 &apos; ' 单引号 &quot; " 双引号 阅读全文

posted @ 2020-01-16 21:26 潮流教父孙笑川 编辑

SpringMvc 定时任务
摘要:SpringMVC 配置定时执行任务 1.在SpringMVC配置文件中添加 xmlns:task="http://www.springframework.org/schema/task" http://www.springframework.org/schema/task http://www.s 阅读全文

posted @ 2020-01-02 23:11 潮流教父孙笑川 编辑

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
点击右上角即可分享
微信分享提示