We can make our servlets thread safe by surrounding the block of code with the synchronized blocks.While a particular synchronized block is executing no other section of code that are synchronized to the same block can execute.
But a more complex servlet need to synchronize its entire method limiting the servlet to one request at a time.This can be done by implementing SingleThreadModel interface. It has no methods.It tells the server to create a pool of instance instead of single instance of the servlet.
Delindia fathima