tomcat源码之connector配置

时间:2022-11-30 16:53:29

连接

tomcat源码之connector配置


acceptor

/**
* Acceptor thread count.
*/
protected int acceptorThreadCount = 0;

处理线程

tomcat源码之connector配置

private int minSpareThreads = 10;
public int getMinSpareThreads() {
return Math.min(minSpareThreads,getMaxThreads());
}
protected int getMaxThreadsExecutor(boolean useExecutor) {
if (useExecutor && executor != null) {
if (executor instanceof java.util.concurrent.ThreadPoolExecutor) {
return ((java.util.concurrent.ThreadPoolExecutor)executor).getMaximumPoolSize();
} else if (executor instanceof ResizableExecutor) {
return ((ResizableExecutor)executor).getMaxThreads();
} else {
return -1;
}
} else {
return maxThreads;
}
}