Is it necessary to mark all the servlet instance variables as \"volatile\" (or to access them from within synchronized sections)? Including those defined in the \"init\" met
The servlet container will make sure there is a memory barrier between the initialization of the servlets and their invocations. You shouldn't have to do anything.
Note: I haven't found such a requirement in the spec, but I would consider it a failure of the container not to do it. BTW, in GenericServlet, the instance variable ServletConfig config
initialized by the init method is not marked as volatile.