Hi All,
According to spec (for SingleThreadModel)
"Ensures that
servlets handle only one request at a time. This interface has no methods. If a servlet implements this interface, you are guaranteed that no two threads will execute concurrently in the servlet's service method. The servlet container can make this guarantee by synchronizing access to a single instance of the servlet, or by maintaining a pool of servlet instances and dispatching each new request to a free servlet"
I have a question on
"or by maintaining a pool of servlet instances and dispatching each new request to a free servlet"
Suppose I have a servlet which does the following (servlet implemented SingleThreadModel)
If container is maintaining pool of instances and the container assigns separate request to separate available instances from the pool, how can the above code
thread safe?
Thanks
Arnab