As we know that we send send a request for a servlet on the server,
the server will create just ONE INSTANCE of that servlet.
in other words just we have one object of that servlet,the life for that object
is based on the life of our server and it will be alive as long as our server is running.
let us say we need to send 50 requests almost in the same time to that servlet.
what I undersatnd the JVM that runs that object will creates 50 threads for those 50 requests.
my question is: Are those threads going to execute piece of code(a method within the servlet class)
(assuming that the piece of code(The method) is NOT SYNCHRONIZED) in the same time?
or the second thread for the second request will wait till the first thread of the first
request finish execution that piece of code.
are we going to have multiple copies of those memebers of that object(i do not think so)?
because we have just one object in the memory.
what i need to understand what is going to happen when we send more than request in the same time to
a servlet on the server?what is happening behind the scene?
the server will create just ONE INSTANCE of that servlet.
in other words just we have one object of that servlet,the life for that object
is based on the life of our server and it will be alive as long as our server is running.
let us say we need to send 50 requests almost in the same time to that servlet.
what I undersatnd the JVM that runs that object will creates 50 threads for those 50 requests.
my question is: Are those threads going to execute piece of code(a method within the servlet class)
(assuming that the piece of code(The method) is NOT SYNCHRONIZED) in the same time?
or the second thread for the second request will wait till the first thread of the first
request finish execution that piece of code.
are we going to have multiple copies of those memebers of that object(i do not think so)?
because we have just one object in the memory.
what i need to understand what is going to happen when we send more than request in the same time to
a servlet on the server?what is happening behind the scene?