Hi,
(1)
If a
servlets implements SingleThreadedModel, then the servlet container would instantiate as many servlet instances as it needs right? If my servlet has a class variable myVar, then would these different servlet instances refer to the SAME myVar?
As a follow-up question to above paragraph, what difference does Instance variable make compared to Class variable? Can we say that Instance variable is
thread safe and Class variable is not?
(2)
As indicated in the specification, "Objects that are accessible to more than one servlet instance at a time, such as instances of HttpSession, [and perhaps Context attributes,] may be available at any particular time to multiple servlets, including those that immplement SingleThreadedModel." It also says "Multipe servlets executing request threads may hae active access to a single sesin object at the same time. The developer has the responsibility for synchronizing access to session resources as appropriate."
Given the above paragraph, can I conclude that session attributes are not thread safe? How about context attributes?
Thank you very very much and more power!

Sincerely,
Marlon Tan