Thank you. After I checked the Git submission record of
org.apache.tomcat.util.threads.ThreadPoolExecutor, I found that the code of
java.util.concurrent.ThreadPoolExecutor was copied to solve bug 65454. Early
org.apache.tomcat.util. threads.ThreadPoolExecutor is implemented by inheriting
java.u
Ok, I'm just curious, because
org.apache.catalina.tribes.util.ExecutorFactory.TribesThreadPoolExecutor
inherits java.util.concurrent.ThreadPoolExecutor but
org.apache.tomcat.util.threads.ThreadPoolExecutor does not.
Similarly, in the open source project dubbo, EagerThreadPoolExecutor inherits
Thank you for your detailed explanation. Now I understand the background of
this part of the comment. When corePoolSize is equal to maxThreads, the native
implementation will create threads first.
There is another question. Why does
org.apache.tomcat.util.threads.ThreadPoolExecutor almost copy
Thank you, I know the role of TaskQueue, but the comment about "normal queue"
on the TaskQueue class is still incomprehensible.
In the java.util.concurrent.ThreadPoolExecutor#execute method, the comment
mentions: "3. If we cannot queue task, then we try to add a new thread. If it
fails, we kno
Tomcat version: 8.5.72
org.apache.tomcat.util.threads.TaskQueue source
code: https://github.com/apache/tomcat/blob/8.5.72/java/org/apache/tomcat/util/threads/TaskQueue.java#L33
In the comments of the TaskQueue class, it mentions "If you use a
normal queue, the executor will spawn threads when