If we hit the same servlet in a new tab then will a new thread be generated to serve the servlet in new tab?
Asked
Active
Viewed 34 times
0
-
2Strictly speaking no, threads are reused since creating a thread is slow, so the threads involved exist before your request comes in. But a simple servlet engine might create a new thread for every request. – Kayaman Apr 14 '22 at 07:07
-
Suppose I open a url in first tab of my browser and then hit the same url in the second tab(first tab still has that servlet url opened). So in this case will the second tab get a new thread? Will it be considered a different request or same request? – krr Apr 15 '22 at 04:00
-
Different request, *could* be served by the same worker thread but there's no guarantee. – Kayaman Apr 17 '22 at 18:52