I searched the archives for an answer to my question, but did not see one
posed exactly like mine.
I am developing a multi-threaded servlet app, and have developed a utility
class (all static methods) that all the servlets use.
For example:
public class Utility
{
public static String convertDouble(double val)
{
NumberFormat nf = NumberFormat.getInstance();
nf.setMaximumFractionDigits(2);
nf.setMinimumFractionDigits(2);
return nf.format(val);
}
}
The above is used in my servlets by invoking the method in this manner:
String str = Utility.convertDouble(setUp);
My question is this ... Do I have to synchronize the static methods in my
Utility class ? Will one thread stomp on another one in the event that
multiple are executing the code at the same time ?
I suspect the answer is yes but I am also worried about all the threads
waiting for synchronized methods.
Thanks in advance and I apologize if this is too basic for this forum ...
maybe I'm brain dead today.
Jim Peters
EDS/Michigan Solution Centre
901 Tower Drive, Mail Stop 1084
Troy, MI 48098
* 248.265.4637
* [EMAIL PROTECTED]
___________________________________________________________________________
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