1. 程式人生 > >深入理解tomcat是怎樣多執行緒處理http請求並將程式碼執行到controller裡的

深入理解tomcat是怎樣多執行緒處理http請求並將程式碼執行到controller裡的

徹底理解tomcat是怎樣多執行緒處理的http請求並將程式碼執行到controller裡的

1.執行緒池:thread=threadPool.getThread().thread.executeHttp(httprequest),thread的start方法執行行裡面呼叫,每個thread裡獲取所有的controller,根據傳進thread的httprequest找到相應的controllerer物件獲取出來,controller物件就開始執行了嘛。

2.軌跡:執行緒池-》執行緒-》傳request-》執行緒  找到對應的controller,執行

3.main執行緒負責向子執行緒傳入引數,任何執行緒的啟動都是由主執行緒來啟動載入的。