Mukul Singh wrote:
>
> If a servlet calls a static method in another class, supposing that the
> class on which we are invoking the method has got static variables which are
> modified by the call to the method in the class. Will this kind of scenario
> lead to some inconsistent results if the servlet does not implement the
> SingleThreadModel?
>


 You can assume that servlets are exactly the same as
any other multithreaded code. So anything accessed by
multiple threads simultaneously is potentially a problem.

 SingleThreadModel probably doesn't do what you think it
does Don't use it unless you are very confident you know
what you're doing. No, I take that back, just don't use
it at all. (If you want details, check the archives)

 The normal Java methods for controlling concurrency
(locks, jvm guarantees, etc) work just the same way in
servlets, it's up to you to apply them appropriately.

 Since "appropriate" is very problem specific, you'll
have to give more info (or some code) if you want a
more detailed answer.


--
Christopher St. John [EMAIL PROTECTED]
DistribuTopia http://www.distributopia.com

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to