[docs fix]文件名规范&错误链接修复
14
README.en.md
@ -44,7 +44,11 @@ Read in other languages: [Mandarin](https://github.com/Snailclimb/JavaGuide/blob
|
|||||||
|
|
||||||
### Basis
|
### Basis
|
||||||
|
|
||||||
**Knowledge points/interview questions**: (Must see:+1: ): [Java Basics Knowledge Points/Interview Questions Summary](docs/java/basis/javabasics-summary.md)
|
**Knowledge points/interview questions**: (Must see:+1: ):
|
||||||
|
|
||||||
|
- [Java Basics Knowledge Points/Interview Questions Summary(1)](docs/java/basis/java-basic-questions-01.md)
|
||||||
|
- [Java Basics Knowledge Points/Interview Questions Summary(2)](docs/java/basis/java-basic-questions-01.md)
|
||||||
|
- [Java Basics Knowledge Points/Interview Questions Summary(3)](docs/java/basis/java-basic-questions-01.md)
|
||||||
|
|
||||||
**Important Knowledge Points Explained:**
|
**Important Knowledge Points Explained:**
|
||||||
|
|
||||||
@ -71,11 +75,11 @@ Read in other languages: [Mandarin](https://github.com/Snailclimb/JavaGuide/blob
|
|||||||
|
|
||||||
**Important Knowledge Points Explained:**
|
**Important Knowledge Points Explained:**
|
||||||
|
|
||||||
1. **Thread pool**: [Java thread pool learning summary](./docs/java/concurrent/java线程池学习总结.md), [Java thread pooling best practices](./docs/java/concurrent/拿来即用的java线程池最佳实践.md)
|
1. **Thread pool**: [Java thread pool learning summary](./docs/java/concurrent/java-thread-pool-summary.md), [Java thread pooling best practices](./docs/java/concurrent/java-thread-pool-best-practices.md)
|
||||||
2. [ThreadLocal keyword resolution](docs/java/concurrent/threadlocal.md)
|
2. [ThreadLocal keyword resolution](docs/java/concurrent/threadlocal.md)
|
||||||
3. [Java concurrency container summary](docs/java/concurrent/并发容器总结.md)
|
3. [Java concurrency container summary](docs/java/concurrent/java-concurrent-collections.md)
|
||||||
4. [Atomic atomic class summary](docs/java/concurrent/atomic原子类总结.md)
|
4. [Atomic atomic class summary](docs/java/concurrent/atomic-classes.md)
|
||||||
5. [AQS principle and AQS synchronization component summary](docs/java/concurrent/aqs原理以及aqs同步组件总结.md)
|
5. [AQS principle and AQS synchronization component summary](docs/java/concurrent/aqs.md)
|
||||||
6. [Getting Started with CompletableFuture](docs/java/concurrent/completablefuture-intro.md)
|
6. [Getting Started with CompletableFuture](docs/java/concurrent/completablefuture-intro.md)
|
||||||
|
|
||||||
### JVM (must see :+1:)
|
### JVM (must see :+1:)
|
||||||
|
59
README.md
@ -1,7 +1,7 @@
|
|||||||
## 👏 重大更新!!!重磅!
|
## 👏 重大更新!!!重磅!
|
||||||
|
|
||||||
- JavaGuide 在线阅读版(新版,推荐👍):https://javaguide.cn/
|
- JavaGuide 在线阅读版(新版,推荐👍):https://javaguide.cn/
|
||||||
- JavaGuide 在线阅读版(老版,部分链接已经无法访问):https://snailclimb.gitee.io/javaguide/#/
|
- JavaGuide 在线阅读版(老版):https://snailclimb.gitee.io/javaguide/#/
|
||||||
- [《JavaGuide 面试突击版》PDF 版本下载](https://mp.weixin.qq.com/s?__biz=Mzg2OTA0Njk0OA==&mid=100029614&idx=1&sn=62993c5cf10265cb7018db7f1ec67250&chksm=4ea1fb6579d67273499b7243641d4ef372decd08047bfbb6dfb5843ef81c7ccba209086cf345#rd)
|
- [《JavaGuide 面试突击版》PDF 版本下载](https://mp.weixin.qq.com/s?__biz=Mzg2OTA0Njk0OA==&mid=100029614&idx=1&sn=62993c5cf10265cb7018db7f1ec67250&chksm=4ea1fb6579d67273499b7243641d4ef372decd08047bfbb6dfb5843ef81c7ccba209086cf345#rd)
|
||||||
|
|
||||||
<a href="https://t.1yb.co/GXLF"><img src="https://img-blog.csdnimg.cn/2f61f3e2d1f2427da977340919e41616.png" style="margin: 0 auto;width:850px" /></a>
|
<a href="https://t.1yb.co/GXLF"><img src="https://img-blog.csdnimg.cn/2f61f3e2d1f2427da977340919e41616.png" style="margin: 0 auto;width:850px" /></a>
|
||||||
@ -43,34 +43,47 @@
|
|||||||
|
|
||||||
### 基础
|
### 基础
|
||||||
|
|
||||||
**知识点/面试题** : (必看:+1: ):[Java 基础知识点/面试题总结](docs/java/basis/java基础知识总结.md)
|
**知识点/面试题** : (必看:+1: ):
|
||||||
|
|
||||||
**重要知识点详解:**
|
- [Java 基础常见知识点&面试题总结(上)](docs/java/basis/java-basic-questions-01.md)
|
||||||
|
- [Java 基础常见知识点&面试题总结(中)](docs/java/basis/java-basic-questions-01.md)
|
||||||
|
- [Java 基础常见知识点&面试题总结(下)](docs/java/basis/java-basic-questions-01.md)
|
||||||
|
|
||||||
|
**重要知识点详解** :
|
||||||
|
|
||||||
- [为什么 Java 中只有值传递?](docs/java/basis/why-there-only-value-passing-in-java.md)
|
- [为什么 Java 中只有值传递?](docs/java/basis/why-there-only-value-passing-in-java.md)
|
||||||
- [什么是反射机制?反射机制的应用场景有哪些?](docs/java/basis/反射机制详解.md)
|
- [什么是反射机制?反射机制的应用场景有哪些?](docs/java/basis/reflection.md)
|
||||||
- [代理模式详解:静态代理+JDK/CGLIB 动态代理实战](docs/java/basis/代理模式详解.md)
|
- [代理模式详解:静态代理+JDK/CGLIB 动态代理实战](docs/java/basis/proxy.md)
|
||||||
- [常见的 IO 模型有哪些?Java 中的 BIO、NIO、AIO 有啥区别?](docs/java/basis/io模型详解.md)
|
- [常见的 IO 模型有哪些?Java 中的 BIO、NIO、AIO 有啥区别?](docs/java/basis/io.md)
|
||||||
- [BigDecimal解决浮点数运算精度丢失问题](docs/java/basis/bigdecimal.md)
|
- [BigDecimal解决浮点数运算精度丢失问题](docs/java/basis/bigdecimal.md)
|
||||||
|
- **[泛型连环炮](docs/java/basis/generics.md)**
|
||||||
|
|
||||||
### 集合
|
### 集合
|
||||||
|
|
||||||
1. **[Java 集合常见问题总结](docs/java/collection/java集合框架基础知识&面试题总结.md)** (必看 :+1:)
|
**知识点/面试题** :
|
||||||
|
|
||||||
|
1. [Java 集合常见知识点&面试题总结(上)](docs/java/collection/java-collection-questions-01.md) (必看 :+1:)
|
||||||
|
2. [Java 集合常见知识点&面试题总结(下)](docs/java/collection/java-collection-questions-02.md) (必看 :+1:)
|
||||||
2. [Java 容器使用注意事项总结](docs/java/collection/java集合使用注意事项.md)
|
2. [Java 容器使用注意事项总结](docs/java/collection/java集合使用注意事项.md)
|
||||||
3. **源码分析** :[ArrayList 源码+扩容机制分析](docs/java/collection/arraylist-source-code.md) 、[HashMap(JDK1.8)源码+底层数据结构分析](docs/java/collection/hashmap-source-code.md) 、[ConcurrentHashMap 源码+底层数据结构分析](docs/java/collection/concurrent-hash-map-source-code.md)
|
|
||||||
|
**源码分析** :
|
||||||
|
|
||||||
|
- [ArrayList 源码+扩容机制分析](docs/java/collection/arraylist-source-code.md)
|
||||||
|
- [HashMap(JDK1.8)源码+底层数据结构分析](docs/java/collection/hashmap-source-code.md)
|
||||||
|
- [ConcurrentHashMap 源码+底层数据结构分析](docs/java/collection/concurrent-hash-map-source-code.md)
|
||||||
|
|
||||||
### 并发
|
### 并发
|
||||||
|
|
||||||
**知识点/面试题:** (必看 :+1:)
|
**知识点/面试题** : (必看 :+1:)
|
||||||
|
|
||||||
1. **[Java 并发基础常见面试题总结](docs/java/concurrent/java并发基础常见面试题总结.md)**
|
1. [Java 并发常见知识点&面试题总结(基础篇)](docs/java/concurrent/java-concurrent-questions-01.md)
|
||||||
2. **[Java 并发进阶常见面试题总结](docs/java/concurrent/java并发进阶常见面试题总结.md)**
|
2. [Java 并发常见知识点&面试题总结(进阶篇)](docs/java/concurrent/java-concurrent-questions-02.md)
|
||||||
|
|
||||||
**重要知识点详解:**
|
**重要知识点详解** :
|
||||||
|
|
||||||
1. **线程池**:[Java 线程池学习总结](./docs/java/concurrent/java线程池学习总结.md)、[拿来即用的 Java 线程池最佳实践](./docs/java/concurrent/拿来即用的java线程池最佳实践.md)
|
1. **线程池** :[Java 线程池详解](./docs/java/concurrent/java-thread-pool-summary.md)、[Java 线程池最佳实践](./docs/java/concurrent/java-thread-pool-best-practices.md)
|
||||||
2. [ThreadLocal 关键字解析](docs/java/concurrent/threadlocal.md)
|
2. [ThreadLocal 关键字解析](docs/java/concurrent/threadlocal.md)
|
||||||
3. [Java 并发容器总结](docs/java/concurrent/并发容器总结.md)
|
3. [Java 并发容器总结](docs/java/concurrent/java-concurrent-collections.md)
|
||||||
4. [Atomic 原子类总结](docs/java/concurrent/atomic原子类总结.md)
|
4. [Atomic 原子类总结](docs/java/concurrent/atomic原子类总结.md)
|
||||||
5. [AQS 原理以及 AQS 同步组件总结](docs/java/concurrent/aqs原理以及aqs同步组件总结.md)
|
5. [AQS 原理以及 AQS 同步组件总结](docs/java/concurrent/aqs原理以及aqs同步组件总结.md)
|
||||||
6. [CompletableFuture入门](docs/java/concurrent/completablefuture-intro.md)
|
6. [CompletableFuture入门](docs/java/concurrent/completablefuture-intro.md)
|
||||||
@ -193,17 +206,17 @@ JVM 这部分内容主要参考 [JVM 虚拟机规范-Java8 ](https://docs.oracle
|
|||||||
|
|
||||||
#### Spring/SpringBoot (必看 :+1:)
|
#### Spring/SpringBoot (必看 :+1:)
|
||||||
|
|
||||||
**知识点/面试题:**
|
**知识点/面试题** :
|
||||||
|
|
||||||
1. **[Spring 常见问题总结](docs/system-design/framework/spring/Spring常见问题总结.md)**
|
1. **[Spring 常见知识点&面试题总结](docs/system-design/framework/spring/spring-knowledge-and-questions-summary.md)**
|
||||||
2. **[SpringBoot 入门指南](https://github.com/Snailclimb/springboot-guide)**
|
2. **[SpringBoot 入门指南](https://github.com/Snailclimb/springboot-guide)**
|
||||||
|
|
||||||
**重要知识点详解:**
|
**重要知识点详解** :
|
||||||
|
|
||||||
1. **[Spring/Spring Boot 常用注解总结!安排!](./docs/system-design/framework/spring/Spring&SpringBoot常用注解总结.md)**
|
1. **[Spring/Spring Boot 常用注解总结!安排!](./docs/system-design/framework/spring/spring-common-annotations.md)**
|
||||||
2. **[Spring 事务总结](docs/system-design/framework/spring/Spring事务总结.md)**
|
2. **[Spring 事务总结](docs/system-design/framework/spring/spring-transaction.md)**
|
||||||
3. [Spring 中都用到了那些设计模式?](docs/system-design/framework/spring/Spring设计模式总结.md)
|
3. [Spring 中都用到了那些设计模式?](docs/system-design/framework/spring/spring-design-patterns-summary.md)
|
||||||
4. **[SpringBoot 自动装配原理?”](docs/system-design/framework/spring/SpringBoot自动装配原理.md)**
|
4. **[SpringBoot 自动装配原理](docs/system-design/framework/spring/spring-boot-auto-assembly-principles.md)**
|
||||||
|
|
||||||
#### MyBatis
|
#### MyBatis
|
||||||
|
|
||||||
@ -220,7 +233,7 @@ JVM 这部分内容主要参考 [JVM 虚拟机规范-Java8 ](https://docs.oracle
|
|||||||
**[《认证授权基础》](docs/system-design/security/basis-of-authority-certification.md)** 这篇文章中我会介绍认证授权常见概念: **Authentication**,**Authorization** 以及 **Cookie**、**Session**、Token、**OAuth 2**、**SSO** 。如果你不清楚这些概念的话,建议好好阅读一下这篇文章。
|
**[《认证授权基础》](docs/system-design/security/basis-of-authority-certification.md)** 这篇文章中我会介绍认证授权常见概念: **Authentication**,**Authorization** 以及 **Cookie**、**Session**、Token、**OAuth 2**、**SSO** 。如果你不清楚这些概念的话,建议好好阅读一下这篇文章。
|
||||||
|
|
||||||
- **JWT** :JWT(JSON Web Token)是一种身份认证的方式,JWT 本质上就一段签名的 JSON 格式的数据。由于它是带有签名的,因此接收者便可以验证它的真实性。相关阅读:
|
- **JWT** :JWT(JSON Web Token)是一种身份认证的方式,JWT 本质上就一段签名的 JSON 格式的数据。由于它是带有签名的,因此接收者便可以验证它的真实性。相关阅读:
|
||||||
- [JWT 优缺点分析以及常见问题解决方案](docs/system-design/security/jwt优缺点分析以及常见问题解决方案.md)
|
- [JWT 优缺点分析以及常见问题解决方案](docs/system-design/security/advantages&disadvantages-of-jwt.md)
|
||||||
- [适合初学者入门 Spring Security With JWT 的 Demo](https://github.com/Snailclimb/spring-security-jwt-guide)
|
- [适合初学者入门 Spring Security With JWT 的 Demo](https://github.com/Snailclimb/spring-security-jwt-guide)
|
||||||
|
|
||||||
- **SSO(单点登录)** :**SSO(Single Sign On)** 即单点登录说的是用户登陆多个子系统的其中一个就有权访问与其相关的其他系统。举个例子我们在登陆了京东金融之后,我们同时也成功登陆京东的京东超市、京东家电等子系统。相关阅读:[**SSO 单点登录看这篇就够了!**](docs/system-design/security/sso-intro.md)
|
- **SSO(单点登录)** :**SSO(Single Sign On)** 即单点登录说的是用户登陆多个子系统的其中一个就有权访问与其相关的其他系统。举个例子我们在登陆了京东金融之后,我们同时也成功登陆京东的京东超市、京东家电等子系统。相关阅读:[**SSO 单点登录看这篇就够了!**](docs/system-design/security/sso-intro.md)
|
||||||
@ -400,7 +413,7 @@ Dubbo 是一款国产的 RPC 框架,由阿里开源。相关阅读:
|
|||||||
### Docker
|
### Docker
|
||||||
|
|
||||||
- [Docker 基本概念解读](./docs/tools/docker/docker-intro.md)
|
- [Docker 基本概念解读](./docs/tools/docker/docker-intro.md)
|
||||||
- [Docker从入门到上手干事](./docs/tools/docker/docker-in-actiono.md)
|
- [Docker从入门到上手干事](./docs/tools/docker/docker-in-action.md)
|
||||||
|
|
||||||
## 关于作者
|
## 关于作者
|
||||||
|
|
||||||
|
@ -191,8 +191,8 @@ module.exports = config({
|
|||||||
"java-concurrent-questions-01", "java-concurrent-questions-02",
|
"java-concurrent-questions-01", "java-concurrent-questions-02",
|
||||||
{
|
{
|
||||||
title: "重要知识点",
|
title: "重要知识点",
|
||||||
children: ["java线程池学习总结", "并发容器总结", "拿来即用的java线程池最佳实践", "aqs原理以及aqs同步组件总结", "reentrantlock",
|
children: ["java-thread-pool-summary", "java-thread-pool-best-practices", "java-concurrent-collections", "aqs", "reentrantlock",
|
||||||
"atomic原子类总结", "threadlocal", "completablefuture-intro"],
|
"atomic-classes", "threadlocal", "completablefuture-intro"],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 31 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 5.0 KiB |
Before Width: | Height: | Size: 47 KiB After Width: | Height: | Size: 47 KiB |
@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
title: JDK 提供的并发容器总结
|
title: Java 常见并发容器总结
|
||||||
category: Java
|
category: Java
|
||||||
tag:
|
tag:
|
||||||
- Java并发
|
- Java并发
|
@ -758,7 +758,7 @@ public void execute(Runnable command) {
|
|||||||
|
|
||||||
通过下图可以更好的对上面这 3 步做一个展示,下图是我为了省事直接从网上找到,原地址不明。
|
通过下图可以更好的对上面这 3 步做一个展示,下图是我为了省事直接从网上找到,原地址不明。
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
现在,让我们在回到 4.6 节我们写的 Demo, 现在是不是很容易就可以搞懂它的原理了呢?
|
现在,让我们在回到 4.6 节我们写的 Demo, 现在是不是很容易就可以搞懂它的原理了呢?
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
title: 拿来即用的Java线程池最佳实践
|
title: Java 线程池最佳实践
|
||||||
category: Java
|
category: Java
|
||||||
tag:
|
tag:
|
||||||
- Java并发
|
- Java并发
|
@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
title: Java线程池学习总结
|
title: Java 线程池详解
|
||||||
category: Java
|
category: Java
|
||||||
tag:
|
tag:
|
||||||
- Java并发
|
- Java并发
|
||||||
@ -59,7 +59,7 @@ public class ScheduledThreadPoolExecutor
|
|||||||
implements ScheduledExecutorService
|
implements ScheduledExecutorService
|
||||||
```
|
```
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
#### 3) 异步计算的结果(`Future`)
|
#### 3) 异步计算的结果(`Future`)
|
||||||
|
|
||||||
@ -69,7 +69,7 @@ public class ScheduledThreadPoolExecutor
|
|||||||
|
|
||||||
### 2.3 Executor 框架的使用示意图
|
### 2.3 Executor 框架的使用示意图
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
1. **主线程首先要创建实现 `Runnable` 或者 `Callable` 接口的任务对象。**
|
1. **主线程首先要创建实现 `Runnable` 或者 `Callable` 接口的任务对象。**
|
||||||
2. **把创建完成的实现 `Runnable`/`Callable`接口的 对象直接交给 `ExecutorService` 执行**: `ExecutorService.execute(Runnable command)`)或者也可以把 `Runnable` 对象或`Callable` 对象提交给 `ExecutorService` 执行(`ExecutorService.submit(Runnable task)`或 `ExecutorService.submit(Callable <T> task)`)。
|
2. **把创建完成的实现 `Runnable`/`Callable`接口的 对象直接交给 `ExecutorService` 执行**: `ExecutorService.execute(Runnable command)`)或者也可以把 `Runnable` 对象或`Callable` 对象提交给 `ExecutorService` 执行(`ExecutorService.submit(Runnable task)`或 `ExecutorService.submit(Callable <T> task)`)。
|
||||||
@ -129,7 +129,7 @@ public class ScheduledThreadPoolExecutor
|
|||||||
|
|
||||||
下面这张图可以加深你对线程池中各个参数的相互关系的理解(图片来源:《Java 性能调优实战》):
|
下面这张图可以加深你对线程池中各个参数的相互关系的理解(图片来源:《Java 性能调优实战》):
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
**`ThreadPoolExecutor` 饱和策略定义:**
|
**`ThreadPoolExecutor` 饱和策略定义:**
|
||||||
|
|
||||||
@ -160,7 +160,7 @@ public class ScheduledThreadPoolExecutor
|
|||||||
> - **`CachedThreadPool` 和 `ScheduledThreadPool`** : 允许创建的线程数量为 `Integer.MAX_VALUE` ,可能会创建大量线程,从而导致 OOM。
|
> - **`CachedThreadPool` 和 `ScheduledThreadPool`** : 允许创建的线程数量为 `Integer.MAX_VALUE` ,可能会创建大量线程,从而导致 OOM。
|
||||||
|
|
||||||
**方式一:通过`ThreadPoolExecutor`构造函数实现(推荐)**
|
**方式一:通过`ThreadPoolExecutor`构造函数实现(推荐)**
|
||||||

|

|
||||||
|
|
||||||
**方式二:通过 `Executor` 框架的工具类 `Executors` 来实现**
|
**方式二:通过 `Executor` 框架的工具类 `Executors` 来实现**
|
||||||
我们可以创建三种类型的 `ThreadPoolExecutor`:
|
我们可以创建三种类型的 `ThreadPoolExecutor`:
|
||||||
@ -171,7 +171,7 @@ public class ScheduledThreadPoolExecutor
|
|||||||
|
|
||||||
对应 Executors 工具类中的方法如图所示:
|
对应 Executors 工具类中的方法如图所示:
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## 四 ThreadPoolExecutor 使用+原理分析
|
## 四 ThreadPoolExecutor 使用+原理分析
|
||||||
|
|
||||||
@ -693,7 +693,7 @@ Wed Nov 13 13:40:43 CST 2019::pool-1-thread-5
|
|||||||
|
|
||||||
`FixedThreadPool` 的 `execute()` 方法运行示意图(该图片来源:《Java 并发编程的艺术》):
|
`FixedThreadPool` 的 `execute()` 方法运行示意图(该图片来源:《Java 并发编程的艺术》):
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
**上图说明:**
|
**上图说明:**
|
||||||
|
|
||||||
@ -743,7 +743,7 @@ Wed Nov 13 13:40:43 CST 2019::pool-1-thread-5
|
|||||||
#### 5.2.2 执行任务过程介绍
|
#### 5.2.2 执行任务过程介绍
|
||||||
|
|
||||||
`SingleThreadExecutor` 的运行示意图(该图片来源:《Java 并发编程的艺术》):
|
`SingleThreadExecutor` 的运行示意图(该图片来源:《Java 并发编程的艺术》):
|
||||||

|

|
||||||
|
|
||||||
**上图说明** :
|
**上图说明** :
|
||||||
|
|
||||||
@ -787,7 +787,7 @@ Wed Nov 13 13:40:43 CST 2019::pool-1-thread-5
|
|||||||
#### 5.3.2 执行任务过程介绍
|
#### 5.3.2 执行任务过程介绍
|
||||||
|
|
||||||
`CachedThreadPool` 的 `execute()` 方法的执行示意图(该图片来源:《Java 并发编程的艺术》):
|
`CachedThreadPool` 的 `execute()` 方法的执行示意图(该图片来源:《Java 并发编程的艺术》):
|
||||||

|

|
||||||
|
|
||||||
**上图说明:**
|
**上图说明:**
|
||||||
|
|
||||||
@ -818,7 +818,7 @@ Wed Nov 13 13:40:43 CST 2019::pool-1-thread-5
|
|||||||
|
|
||||||
### 6.2 运行机制
|
### 6.2 运行机制
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
**`ScheduledThreadPoolExecutor` 的执行主要分为两大部分:**
|
**`ScheduledThreadPoolExecutor` 的执行主要分为两大部分:**
|
||||||
|
|
||||||
@ -833,7 +833,7 @@ Wed Nov 13 13:40:43 CST 2019::pool-1-thread-5
|
|||||||
|
|
||||||
### 6.3 ScheduledThreadPoolExecutor 执行周期任务的步骤
|
### 6.3 ScheduledThreadPoolExecutor 执行周期任务的步骤
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
1. 线程 1 从 `DelayQueue` 中获取已到期的 `ScheduledFutureTask(DelayQueue.take())`。到期任务是指 `ScheduledFutureTask`的 time 大于等于当前系统的时间;
|
1. 线程 1 从 `DelayQueue` 中获取已到期的 `ScheduledFutureTask(DelayQueue.take())`。到期任务是指 `ScheduledFutureTask`的 time 大于等于当前系统的时间;
|
||||||
2. 线程 1 执行这个 `ScheduledFutureTask`;
|
2. 线程 1 执行这个 `ScheduledFutureTask`;
|
@ -9,7 +9,6 @@
|
|||||||
name="viewport"
|
name="viewport"
|
||||||
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"
|
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"
|
||||||
/>
|
/>
|
||||||
<link rel="stylesheet" href="//unpkg.com/docsify/lib/themes/prism.css" />
|
|
||||||
<!--主题-->
|
<!--主题-->
|
||||||
<link rel="stylesheet" href="//unpkg.com/docsify/lib/themes/vue.css" />
|
<link rel="stylesheet" href="//unpkg.com/docsify/lib/themes/vue.css" />
|
||||||
</head>
|
</head>
|
||||||
|