HTTP Status 404 - Servlet action is not available
A servlet is not a "program". It is a component of a deployed Web Application that presents a service method, which (usually) routes an incoming URL request to a secondary method such as doGet() or doPost().
The servlet operates when the container obtains a thread from the container's Thread Pool and runs it with a request to invoke the servlet's service() method. So, yes, servlets must be thread-safe as must any code that they invoke.
Being "thread-safe", however, does not give one license to lock the servlet for long periods of time, nor may the servlet spawn secondary threads for long-running tasks. There are tricks to managing such things, but explaining them is for another time.