You are correct. You don't have to worry about synchronization if the
threads are calling methods where all variable access is local to the
method. You do need to handle synchronization if the methods access instance
or class variables. I don't recommend using the SingleThread Model.

The best way to handle synchronization issues is to use a synchronized block
around the code accessing the shared resource.

Grant


-----Original Message-----
From: Jeetandra Mahtani [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 06, 1999 8:53 AM
To: [EMAIL PROTECTED]
Subject: Can some explain/confirm


Hello,
Can someone please confirm the following and maybe provide some insight to
make my
concepts thorough.
If there are no instance variables and only local variables, one does not
need to worry
about different threads accessing the same variable, right?
If only local variables are being used in all classes, does one need to
worry about
synchronization/thread issues?
When does one need to use the SingleThread Model ?
Thanks for any information.
J

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.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

___________________________________________________________________________
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