I thank you very much for the patience and your time to answer the basic questions I have regarding the threads in web applications..
Please let me know if you need any more information to clarify my doubts.
1.) Based on my knowledge each http request creates its own
thread. Is that correct?
2) Do we say a web application is multithreaded only when a piece of code inside the app for the given http request, is creating its own new threads (apart from the main thread created for the original http request)
(like for example new Thread-->run() kind of stuff) .
OR
Can we say a webapp is multi threaded because there are several http request at the same time
(assuming no code is creating its own new threads).
3) Assuming a particular Class A is not singleton and does not have any static elements and assuming app is creating new threads inside a piece of
code for a given http request and using the object(objectA of class A).
We need to worry about thread safety in this case as the same object is shared across different threads. Is that correct?
4) Assuming a particular object is not singleton and does not have any static elements and Assuming NO piece of code creating new threads.
We dont need to worry about thread safety of this object for multiple http requests that web applciation receives at the same time. In this case each http request creates its own object instance (objectA1 for httprequest1 and objectA2 for httprequest2) and so we dont have to worry about thread safety , if that correct?