我对Tomcat线程创建有一个基本问题。是每个浏览器实例都在单个线程上运行,还是会生成多个线程来处理单个浏览器实例请求?
我正在代码中引用当前线程,并调用activecount方法,它显示20指示20个活动线程。因此,我怀疑从何处配置此值。是否有任何参数可以设置每个线程的活动线程
while (iter.hasNext()) {
GrammarSection agrammarSection= null;
try {
agrammarSection = (GrammarSection) iter.next();
} catch (Exception e) {
System.out.println("DDD if it come in exception "+Thread.currentThread());
System.out.println("DDD if it come in exception "+Thread.activeCount()); //IT PRINTS 20
Tomcat创建一个线程池。通常,一个线程处理一个HTTP请求。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句