-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Romu,

Romu wrote:
> http://www-128.ibm.com/developerworks/library/j-dcl.html
> 
> if u use jdk1.5 , it's the second time i read that volatile is a good
> solution .

A few notes:

1. volatile has been available since the beginning. JDK 1.5 is not
   required.
2. volatile only refers to a particular variable, not an object.
   In this case, the object /reference/ will be 'volatile', and
   therefore will not be stored in the thread's local cache.
3. Since we're talking about a singleton, the reference's value should
   never change across the life of the application (assuming that the
   singleton has been correctly implemented)

Using volatile in this case will not add anything at all.

- -chris

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGABo39CaO5/Lv0PARAprgAJ446cu5g+9seW4y+gYJRVw6is4OhQCbBaRB
r/Ws4nPdmjNcYmLvk4Vq4f8=
=vaIY
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to