摘要: - 继承Thread 继承Thread类,重写run方法实现多线程 package com.noneplus; class Task1 extends Thread { @Override public void run() { for (int i = 0; i < 10; i++) { Syst 阅读全文
posted @ 2020-08-06 18:44 just-reboot 阅读(458) 评论(2) 推荐(0) 编辑
摘要: ThreadPoolExecutor:JDK内置线程池实现 ThreadPoolTaskExecutor:Spring对JDK中线程池做了一层封装 参考代码:https://github.com/Noneplus/ConcurrentDemo 创建一个SpringBoot项目 主类开启异步注解 /* 阅读全文
posted @ 2020-08-06 18:42 just-reboot 阅读(414) 评论(0) 推荐(0) 编辑