-----------------------------------------------------------

New Message on cochindotnet

-----------------------------------------------------------
From: Nasha
Message 1 in Discussion


Hi 
All,
 
C# has 
a keyword named  "volatile".  This keyword is used to mark a 
particular object "volatile" . i.e. the value of this object can change any time 
in the program by any other thread or process and thus the system always reads 
the current value of such an object as the value of this object will never be 
cached.

This modifier is generally used if there are multiple threads using the same 
object without using the "lock" keyword. Using the volatile modifier ensures 
that all threads retrieve the latest value of the object.

Using volatile key word does not solve the thread synchronization 
problem.

Objects which can be marked volatile can be :

        Any reference type. 
        Any pointer type (in an unsafe context). 
        Datatypes like sbyte, byte, short, ushort, int, uint, char, float, bool. 
  
        An enum type with an enum base type of byte, sbyte, short, ushort, int, or 
  uint. 
 
-- Please post your queries and comments for my 
articles in the usergroup for the benefit of all. I hope this step from my end 
is helpful to all of us. 


Regards,

Namratha (Nasha).

-----------------------------------------------------------

To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings.
http://groups.msn.com/cochindotnet/_emailsettings.msnw

Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help

For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact

If you do not want to receive future e-mail from this MSN group, or if you received 
this message by mistake, please click the "Remove" link below. On the pre-addressed 
e-mail message that opens, simply click "Send". Your e-mail address will be deleted 
from this group's mailing list.
mailto:[EMAIL PROTECTED]

Reply via email to