
多线程
爱喝冰阔乐
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
synchronized
用户态与内核态 JDK早期,synchronized 叫做重量级锁, 因为申请锁资源必须通过kernel, 系统调用 ;hello.asm ;write(int fd, const void *buffer, size_t nbytes) section data msg db "Hello", 0xA len equ $ - msg section .text global _start _start: mov edx, len mov ecx, msg原创 2020-06-12 18:11:04 · 362 阅读 · 0 评论 -
Runnable+线程池
1.创建线程池 private ExecutorService executor; /** *启动项目的同时创建线程池 */ @PostConstruct private void initThreadPool() { executor = new ThreadPoolExecutor(5, 10, 1000, TimeUnit.SECONDS, linkedBlockingQueue);.原创 2020-05-20 10:20:36 · 732 阅读 · 0 评论 -
Callbale+线程池
一创建线程池和Callable任务 1.创建线程池 //创建线程池 public class ThreadExecutors { /** * 初始化线程池 */ static ThreadPoolExecutor pool = initExecutorPool(); public static String ThreadResult(Req req) { String respMsg = null; Future<.原创 2020-05-20 10:12:51 · 847 阅读 · 0 评论