1. 程式人生 > >tomcat源碼之connector配置

tomcat源碼之connector配置

pool != protect ads lex png 圖片 技術分享 thread

連接

技術分享圖片


acceptor

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

處理線程

技術分享圖片

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;
}
}

tomcat源碼之connector配置