File tree 2 files changed +3
-3
lines changed
2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -21,10 +21,10 @@ CPU 通过给每个线程分配一定的时间片,由于时间非常短通常
21
21
22
22
- 尽量一个线程只获取一个锁。
23
23
- 一个线程只占用一个资源。
24
- - 尝试是用定时锁 ,至少能保证锁最终会被释放。
24
+ - 尝试使用定时锁 ,至少能保证锁最终会被释放。
25
25
26
26
## 资源限制
27
27
28
28
当在带宽有限的情况下一个线程下载某个资源需要 ` 1M/S ` ,当开 10 个线程时速度并不会乘 10 倍,反而还会增加时间,毕竟上下文切换比较耗时。
29
29
30
- 如果是受限于资源的话可以采用集群来处理任务,不同的机器来处理不同的数据,就类似于开始提到的无锁编程。
30
+ 如果是受限于资源的话可以采用集群来处理任务,不同的机器来处理不同的数据,就类似于开始提到的无锁编程。
Original file line number Diff line number Diff line change 18
18
- [ ReentrantLock 实现原理 ] ( https://github.com/crossoverJie/Java-Interview/blob/master/MD/ReentrantLock.md )
19
19
- [ ConcurrentHashMap 的实现原理] ( https://github.com/crossoverJie/Java-Interview/blob/master/MD/ConcurrentHashMap.md )
20
20
- [ 线程池原理] ( https://github.com/crossoverJie/Java-Interview/blob/master/MD/ThreadPoolExecutor.md )
21
- - [ 线程间通信 ] ( https://github.com/crossoverJie/Java-Interview/blob/master/src/main/java/com/crossoverjie/actual/ThreadCommunication.java )
21
+ - [ 深入理解线程通信 ] ( https://github.com/crossoverJie/Java-Interview/blob/master/MD/concurrent/thread-communication.md )
22
22
- [ 交替打印奇偶数] ( https://github.com/crossoverJie/Java-Interview/blob/master/src/main/java/com/crossoverjie/actual/TwoThread.java )
23
23
24
24
### JMM(Java 内存模型)
You can’t perform that action at this time.
0 commit comments