Threading Issues
A web server may call the applet’s service method for more than one request at a time by creating multiple threads.
- You can disallow this by using javax.servlet.SingleThreadModel, which makes it possible to write simple servlets where only one instance of the service method is ever running at one time.
If your service method uses outside resources, such as instance data from the servlet object, files, or databases, you must carefully consider what might happen under multiple calls to the service method, and use synchronization where appropriate.