Skip to content

Commit 9047b7e

Browse files
committed
update java线程池学习总结.md
1 parent b7f31ba commit 9047b7e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/java/multi-thread/java线程池学习总结.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -715,7 +715,7 @@ Wed Nov 13 13:40:43 CST 2019::pool-1-thread-5
715715

716716
#### 5.1.3 为什么不推荐使用`FixedThreadPool`
717717

718-
**`FixedThreadPool` 使用无界队列 `LinkedBlockingQueue`(队列的容量为 Intger.MAX_VALUE)作为线程池的工作队列会对线程池带来如下影响 :**
718+
**`FixedThreadPool` 使用无界队列 `LinkedBlockingQueue`(队列的容量为 Integer.MAX_VALUE)作为线程池的工作队列会对线程池带来如下影响 :**
719719

720720
1. 当线程池中的线程数达到 `corePoolSize` 后,新任务将在无界队列中等待,因此线程池中的线程数不会超过 corePoolSize;
721721
2. 由于使用无界队列时 `maximumPoolSize` 将是一个无效参数,因为不可能存在任务队列满的情况。所以,通过创建 `FixedThreadPool`的源码可以看出创建的 `FixedThreadPool``corePoolSize``maximumPoolSize` 被设置为同一个值。

0 commit comments

Comments
 (0)