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.util.concurrent.ThreadPoolExecutor. Because the code to fix the bug 65454 needs to modify the code in the java.util.concurrent.ThreadPoolExecutor.Worker class, it cannot be implemented by inheriting java.util.concurrent.ThreadPoolExecutor at this time. Now I understand why this is needed, thank you for your explanation.
https://bz.apache.org/bugzilla/show_bug.cgi?id=65454#c7 ------------------ Original ------------------ From: "Tomcat Users List" <ma...@apache.org>; Date: Wed, Oct 27, 2021 05:11 PM To: "users"<users@tomcat.apache.org>; Subject: Re: About the comment of org.apache.tomcat.util.threads.TaskQueue 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 behaviours. > Similarly, in the open source project dubbo, EagerThreadPoolExecutor inherits java.util.concurrent.ThreadPoolExecutor to achieve similar functions as the tomcat thread pool. > > > https://github.com/apache/dubbo/blob/dubbo-2.7.5/dubbo-common/src/main/java/org/apache/dubbo/common/threadpool/support/eager/EagerThreadPoolExecutor.java#L30 The Dubbo implementation does not appear to achieve the behaviour Tomcat requires. Mark --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org