-----Original Message-----
From: Nic Ferrier <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: Tuesday, September 07, 1999 8:19 AM
Subject: Re: Thread Safety


>>>> Dino Valente <[EMAIL PROTECTED]> 9/7/99 3:36:53 PM >>>
>>Do you need to synchronize if you ONLY access data members or
>static
>>variables?
>
>Yes.
>
>(I presume you mean class instance data by data members).
>
>
>
>Nic
>


Really. I wouldn't have expected to. For example if I had a Servlet such as

class TestServlet extends HttpServlet {

    private String instance1 = "never to be assigned again";
    private final static String instance2 = "never to be assigned again
too";

...

}

I would have to call synchronize(this) every single time I needed to access
instance1 and instance2? How could this be (I'm only accessing and never
setting)? Could you explain?

dino

___________________________________________________________________________
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