Skip to content

Commit fc13653

Browse files
author
haiyang.luo
committed
新增ThreadPoolExecutor源码解析
1 parent a892201 commit fc13653

3 files changed

Lines changed: 847 additions & 0 deletions

File tree

JdkLearn/src/main/java/com/learnjava/concurent/ThreadPoolExecutorDemo.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
package com.learnjava.concurent;
22

3+
import java.util.concurrent.ExecutorService;
4+
import java.util.concurrent.Executors;
5+
import java.util.concurrent.ThreadPoolExecutor;
36
import java.util.concurrent.atomic.AtomicInteger;
47

58
/**
@@ -18,6 +21,12 @@ public static void main(String[] args) {
1821
* 验证ThreadPoolExecutor中的二进制位运算操作
1922
*/
2023
private static void testThreadPoolExecutorBinaryCalc() {
24+
ExecutorService executorService = Executors.newFixedThreadPool(5);
25+
executorService.execute(() -> {
26+
System.out.println("executor test...");
27+
});
28+
29+
2130
// System.out.println(ctl.get());
2231
// System.out.println(Integer.toBinaryString(ctlOf(RUNNING, 0)));
2332
// System.out.println(Integer.toBinaryString(RUNNING));

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ Java流行框架源码分析,学习以及总结。项目持续更新中,不
3131

3232
框架包括:
3333

34+
✅ JDK源码
35+
36+
✅ JUC源码
3437

3538
✅ Spring源码
3639

@@ -76,6 +79,7 @@ SpringCloud源码
7679
- [深入学习Thread底层原理](https://github.com/coderbruis/JavaSourceCodeLearning/blob/master/note/JDK/%E6%B7%B1%E5%85%A5%E5%AD%A6%E4%B9%A0Thread%E5%BA%95%E5%B1%82%E6%BA%90%E7%A0%81.md)
7780
- [深入学习JDK1.7、8 HashMap扩容原理]()
7881
- [开源项目里那些看不懂的位运算分析](https://github.com/coderbruis/JavaSourceCodeLearning/blob/master/note/JDK/%E5%BC%80%E6%BA%90%E9%A1%B9%E7%9B%AE%E9%87%8C%E9%82%A3%E4%BA%9B%E7%9C%8B%E4%B8%8D%E6%87%82%E7%9A%84%E4%BD%8D%E8%BF%90%E7%AE%97%E5%88%86%E6%9E%90.md)
82+
- [ThreadPoolExecutor源码分析]()
7983

8084
- Spring源码学习
8185
- Spring版本:5.2.1.RELEASE

0 commit comments

Comments
 (0)