Home Async servlet , why do we need it
Reply: 0

Async servlet , why do we need it

user986 Published in April 22, 2018, 10:08 pm

I'm using Spring-boot for MVC projects with embedded tomcat(8).

I know about the following problem: when request is come we give one thread from tomcat connection pool to proceed this request,and for example we call some blocking API so our thread will do nothing except waiting and then return response for client. Now we have Callable and DifferedResult classes which use thread from executorservice that we will provide as Bean (otherwise it create new thread for each request)

For example Tomcat's connection pool is 100 threads, and connection pool for async calls is also 100, when request is come it get thread from Tomcat, then tomcat will get request to one of the worker thread from executor service and will return to the pool of Tomcat threads. But i don't understand , why do we need another thread pool , why we can't just increase the number of Tomcat threads to get the same result as with using worker pool ?

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.304774 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO