Re: About the comment of org.apache.tomcat.util.threads.TaskQueue

2021-10-27 Thread Poison
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

Re: About the comment of org.apache.tomcat.util.threads.TaskQueue

2021-10-27 Thread Mark Thomas
On 27/10/2021 02:58, Poison wrote: 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. They are implementing different

Re: About the comment of org.apache.tomcat.util.threads.TaskQueue

2021-10-26 Thread Poison
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

Re: [OT] About the comment of org.apache.tomcat.util.threads.TaskQueue

2021-10-26 Thread Christopher Schultz
Mark, On 10/26/21 15:56, Mark Thomas wrote: On 26/10/2021 09:47, Poison wrote: 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

Re: About the comment of org.apache.tomcat.util.threads.TaskQueue

2021-10-26 Thread Mark Thomas
On 26/10/2021 09:47, Poison wrote: 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

Re: About the comment of org.apache.tomcat.util.threads.TaskQueue

2021-10-26 Thread Poison
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

Re: About the comment of org.apache.tomcat.util.threads.TaskQueue

2021-10-26 Thread Mark Thomas
On 26/10/2021 02:45, Poison wrote: 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

Re: About the comment of org.apache.tomcat.util.threads.TaskQueue

2021-10-25 Thread Poison
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

Re: About the comment of org.apache.tomcat.util.threads.TaskQueue

2021-10-25 Thread Christopher Schultz
tianshuang, On 10/23/21 23:44, Poison wrote: Tomcat version: 8.5.72 org.apache.tomcat.util.threads.TaskQueuesource code:https://github.com/apache/tomcat/blob/8.5.72/java/org/apache/tomcat/util/threads/TaskQueue.java#L33 In the comments of theTaskQueueclass, it mentions "If you use a normal

About the comment of org.apache.tomcat.util.threads.TaskQueue

2021-10-23 Thread Poison
Tomcat version: 8.5.72 org.apache.tomcat.util.threads.TaskQueuesource code:https://github.com/apache/tomcat/blob/8.5.72/java/org/apache/tomcat/util/threads/TaskQueue.java#L33 In the comments of theTaskQueueclass, it mentions "If you use a normal queue, the executor will spawn threads when