volatile - small question

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



I am right in thinking that if I have a class that can be accessed by
more than one thread in my application then I should mark *all*
instance variables within that class with the volatile keyword.
Also is it right that if the access to the variable is within a lock
then this is not required, since all 'memory'/caches are up to date

Thanks in advance
Nick
.



Relevant Pages

  • Re: HBA performance test. ideal setup?
    ... Thanks a lot for the comments Nick and Mark. ... I mean HBA connected to a 4 gig Brocade switch and on the other ... Prev by Date: ...
    (microsoft.public.exchange.setup)
  • Re: volatile - small question
    ... > more than one thread in my application then I should mark *all* ... > instance variables within that class with the volatile keyword. ... Jon Skeet - ...
    (microsoft.public.dotnet.languages.csharp)
  • Web Services and Threads
    ... When designing a program to expose as a web service, ... thread safe. ... I mean instance variables of classes. ... Prev by Date: ...
    (comp.lang.java.programmer)
  • Re: global variables are bad??
    ... On Monday 09 January 2006 10:15 pm, Lyndon Samson wrote: ... >) instance variables. ... Steve Litt ... Prev by Date: ...
    (comp.lang.ruby)
  • Re: Constructors + Information Hiding
    ... >//I know why this would be a useful constructor, ... http://mindprod.com Again taking new Java programming contracts. ... Prev by Date: ...
    (comp.lang.java.help)