
Thread & Concurrent
thread、juc
一只倔强的蜗牛
编码人生,深耕技术
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Java TheadLocal
The ThreadLocal class in Java enables you to create variables that can only be read and written by the same thread. Thus, even if two threads are executing the same code, and the code has a reference ...翻译 2018-07-15 21:50:22 · 204 阅读 · 0 评论 -
Java 并发工具包 java.util.concurrent 用户指南(转)
目录1. java.util.concurrent - Java 并发工具包2. 阻塞队列 BlockingQueueBlockingQueue 用法BlockingQueue 的方法BlockingQueue 的实现Java 中使用 BlockingQueue 的例子3. 数组阻塞队列 ArrayBlockingQueue4. 延迟队列 DelayQueue5...转载 2018-10-04 18:11:37 · 251 阅读 · 0 评论 -
JDK 线程池
一. 为什么用线程池(线程池的作用)1. 创建/销毁线程伴随着系统开销,过于频繁的创建/销毁线程,会很大程度上影响处理效率例如:记创建线程消耗时间T1,执行任务消耗时间T2,销毁线程消耗时间T3如果T1+T3>T2,那么是不是说开启一个线程来执行这个任务太不划算了!正好,线程池缓存线程,可用已有的闲置线程来执行新任务,避免了T1+T3带来的系统开销2. 线程并发数...原创 2018-10-07 12:22:40 · 359 阅读 · 0 评论 -
Java 并发
目录一、线程状态转换二、使用线程实现 Runnable 接口实现 Callable 接口继承 Thread 类实现接口 VS 继承 Thread三、基础线程机制ExecutorDaemonsleep()yield()四、中断InterruptedExceptioninterrupted()Executor 的中断操作五、互斥同步s...原创 2018-11-28 14:43:29 · 182 阅读 · 0 评论