Each request is processed in a separated thread. This doesn’t mean Tomcat creates a new thread per request. There is a pool of threads to process requests. Also there is a single instance for each servlet and this is the default case.(Some more information).
Your servlet should be Thread Safe
i.e. it should be stateless.
If your servlet implements SingleThreadModel
interface, each thread uses separate instance of servlet. SingleThreadModel
is deprecated, Don’t use it.
I made this answer as community wiki.