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