role of multithreading in web application

Viewed 34435

I am using java(Servlets, JSPs) since 2 years for web application development. In those 2 years I never required to use multithreading(explicitly - as I know that servlet containers uses threading to serve same servlet to different requests) in any project.

But whenever I attend an interview for Web Developer position(java), then there are several questions related to threads in java. I know the basics of java threading so answering the questions is not a problem. But sometimes I get confused whether I am missing something while developing web application by not using mutithreading?

So my question is that what is the role of multithreading in Web Application? Any example where multithreading can be used in web application will be appreciated.

Thanks in advance.

4 Answers

Multi-treading in web application can be used when you are interested in parallel action, e.g., fetching data from multiple addresses.

As I understand, multi-threading is used in different situation from thread-pool, which can be used to handle requests from multiple clients.

Related