Merged
Conversation
销毁并不只针对核心线程,会对核心线程和非核心线程一视同仁。 参见《Java 性能调优实战》
Owner
感谢修正👍 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
销毁并不只针对核心线程,会对核心线程和非核心线程一视同仁。
也就是allowCoreThreadTimeOut默认是false的情况下,线程数超过corePoolSize时,等待时间大于keepAliveTime,在回收空闲线程时,会对核心线程和非核心线程一视同仁,并不只回收非核心线程中的空闲线程,如果核心线程有空闲的也会回收,直到线程数等于corePoolSize。
额外补充:
allowCoreThreadTimeOut是true的情况下,即使线程数不超过corePollSize,等待时间大于keepAliveTime,即只有核心线程时,也会进行回收。
参见《Java 性能调优实战》