我感覺好像tomcat啟動(dòng)的線程所占用的資源好像更多也更珍貴,直接和吞吐量相關(guān),所以現(xiàn)在采用nio模式來盡快歸還Tomcat的線程來提供并發(fā),到底是不是我理解的這樣呢?
2 回答

偶然的你
TA貢獻(xiàn)1841條經(jīng)驗(yàn) 獲得超3個(gè)贊
/** * Same as a java.util.concurrent.ThreadPoolExecutor but implements a much more efficient * {@link #getSubmittedCount()} method, to be used to properly handle the work queue. * If a RejectedExecutionHandler is not specified a default one will be configured * and that one will always throw a RejectedExecutionException * */
tomcat的線程池對象也叫ThreadPoolExecutor ,繼承jdk的java.util.concurrent.ThreadPoolExecutor,但是它實(shí)現(xiàn)了一個(gè)高效的方法getSubmittedCount()方法用來處理工作隊(duì)列。
具體可以看org.apache.tomcat.util.threads包下面的幾個(gè)類的源碼。

慕蓋茨4494581
TA貢獻(xiàn)1850條經(jīng)驗(yàn) 獲得超11個(gè)贊
一個(gè)東西.
servlet規(guī)范規(guī)定了每一個(gè)請求都需要由一個(gè)單獨(dú)的線程處理.
添加回答
舉報(bào)
0/150
提交
取消