What is Thread Safe Servlet
By Ramakrishna on Oct 16, 2008 in What is Thread Safe Servlet
–> A thread-safe servlet is one that works correctly when more than one thread is running at the same time.
–> To synchronize access to a method or a block of code, you can use the synchronized keyword. Then, only one thread at a time can access the code in the block or the method.
–> To prevent multiple threads from accessing the code in a servlet, you can implement the SingleThreadModel interface. This is a tagging interface that prevents two threads from accessing the servlet’s service method at the same time.
