JDK源码赏析部分 内容结构调整
This commit is contained in:
parent
d68a59ba15
commit
4f059d00a0
28
README.md
28
README.md
@ -221,15 +221,25 @@
|
||||
* 努力编写中...
|
||||
|
||||
## 番外篇(JDK 1.8)
|
||||
|
||||
* [Executor 线程池组件 源码赏析](docs/JDK/Executor线程池组件.md)
|
||||
* [Lock 锁组件 源码赏析](docs/JDK/Lock锁组件.md)
|
||||
* [Thread类 源码赏析](docs/JDK/Thread.md)
|
||||
* [ThreadLocal类 源码赏析](docs/JDK/ThreadLocal.md)
|
||||
* [HashMap类 源码赏析](docs/JDK/HashMap.md)
|
||||
* [ConcurrentHashMap类 源码赏析](docs/JDK/ConcurrentHashMap.md)
|
||||
* [String类 源码赏析](docs/JDK/String.md)
|
||||
|
||||
### 基础类库
|
||||
* [String类 源码赏析](docs/JDK/basic/String.md)
|
||||
* [Thread类 源码赏析](docs/JDK/basic/Thread.md)
|
||||
* [ThreadLocal类 源码赏析](docs/JDK/basic/ThreadLocal.md)
|
||||
### 集合
|
||||
* [HashMap类 源码赏析](docs/JDK/collection/HashMap.md)
|
||||
* [ConcurrentHashMap类 源码赏析](docs/JDK/collection/ConcurrentHashMap.md)
|
||||
* [LinkedHashMap类 源码赏析](docs/JDK/collection/LinkedHashMap.md)
|
||||
* [ArrayList类 源码赏析](docs/JDK/collection/ArrayList.md)
|
||||
* [LinkedList类 源码赏析](docs/JDK/collection/LinkedList.md)
|
||||
* [HashSet类 源码赏析](docs/JDK/collection/HashSet.md)
|
||||
* [TreeSet类 源码赏析](docs/JDK/collection/TreeSet.md)
|
||||
### 并发编程
|
||||
* [Executor 线程池组件 源码赏析](docs/JDK/concurrentCoding/Executor线程池组件.md)
|
||||
* [Lock 锁组件 源码赏析](docs/JDK/concurrentCoding/Lock锁组件.md)
|
||||
* [详解AbstractQueuedSynchronizer抽象类](docs/JDK/concurrentCoding/详解AbstractQueuedSynchronizer.md)
|
||||
* [CountdownLatch类 源码赏析](docs/JDK/concurrentCoding/CountdownLatch.md)
|
||||
* [CyclicBarrier类 源码赏析](docs/JDK/concurrentCoding/CyclicBarrier.md)
|
||||
* [Semaphore类 源码赏析](docs/JDK/concurrentCoding/Semaphore.md)
|
||||
## 学习心得
|
||||
|
||||
### 个人经验
|
||||
|
@ -317,4 +317,4 @@ public class Thread implements Runnable {
|
||||
```
|
||||
之前一直对线程状态 及 状态切换的概念模糊不清,现在通过源码中对线程状态的定义,我们可以画张图来重新回顾一下,以使我们对其有更加深刻的理解。
|
||||
|
||||

|
||||

|
@ -258,7 +258,7 @@ public class ThreadLocal<T> {
|
||||
```
|
||||
简单画个图总结一下 ThreadLocal 的原理,如下。
|
||||
|
||||

|
||||

|
||||
|
||||
最后强调一下 ThreadLocal的使用注意事项:
|
||||
|
1
docs/JDK/collection/ArrayList.md
Normal file
1
docs/JDK/collection/ArrayList.md
Normal file
@ -0,0 +1 @@
|
||||
努力编写中...
|
1
docs/JDK/collection/HashSet.md
Normal file
1
docs/JDK/collection/HashSet.md
Normal file
@ -0,0 +1 @@
|
||||
努力编写中...
|
1
docs/JDK/collection/LinkedHashMap.md
Normal file
1
docs/JDK/collection/LinkedHashMap.md
Normal file
@ -0,0 +1 @@
|
||||
努力编写中...
|
1
docs/JDK/collection/LinkedList.md
Normal file
1
docs/JDK/collection/LinkedList.md
Normal file
@ -0,0 +1 @@
|
||||
努力编写中...
|
1
docs/JDK/collection/TreeSet.md
Normal file
1
docs/JDK/collection/TreeSet.md
Normal file
@ -0,0 +1 @@
|
||||
努力编写中...
|
1
docs/JDK/concurrentCoding/CountdownLatch.md
Normal file
1
docs/JDK/concurrentCoding/CountdownLatch.md
Normal file
@ -0,0 +1 @@
|
||||
努力编写中...
|
1
docs/JDK/concurrentCoding/CyclicBarrier.md
Normal file
1
docs/JDK/concurrentCoding/CyclicBarrier.md
Normal file
@ -0,0 +1 @@
|
||||
努力编写中...
|
@ -1,7 +1,7 @@
|
||||
## 线程池核心组件图解
|
||||
看源码之前,先了解一下该组件 最主要的几个 接口、抽象类和实现类的结构关系。
|
||||
|
||||

|
||||

|
||||
|
||||
该组件中,Executor 和 ExecutorService接口 定义了线程池最核心的几个方法,提交任务submit
|
||||
()、关闭线程池shutdown()。抽象类 AbstractExecutorService 主要对公共行为 submit()系列方法进行了实现,这些 submit()方法 的实现使用了 模板方法模式,其中调用的 execute()方法 是未实现的 来自 Executor接口 的方法。实现类 ThreadPoolExecutor 则对线程池进行了具体而复杂的实现。
|
@ -1,11 +1,11 @@
|
||||
## 类图结构
|
||||
J.U.C 的锁组件中 类相对较少,从JDK相应的包中也能看出来,下图标记了其中最主要的几个接口和类,也是本文要分析的重点。
|
||||
|
||||

|
||||

|
||||
|
||||
下图 将这几个接口和类 以类图的方式展现出来,其中包含了它们所声明的主要方法。
|
||||
|
||||

|
||||

|
||||
|
||||
## Lock 组件
|
||||
Lock 组件的结构很简单,只有一个接口和一个实现类,源码如下。
|
1
docs/JDK/concurrentCoding/Semaphore.md
Normal file
1
docs/JDK/concurrentCoding/Semaphore.md
Normal file
@ -0,0 +1 @@
|
||||
努力编写中...
|
1
docs/JDK/kong.md
Normal file
1
docs/JDK/kong.md
Normal file
@ -0,0 +1 @@
|
||||
努力编写中...
|
Loading…
x
Reference in New Issue
Block a user