tag:blogger.com,1999:blog-694855878384792308.post4967125184603228072..comments2024-03-21T06:26:49.387-07:00Comments on Java67: What is Volatile Variable in Java? When to Use it? Examplejavin paulhttp://www.blogger.com/profile/15028902221295732276noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-694855878384792308.post-55938963610147900072018-05-11T05:02:46.089-07:002018-05-11T05:02:46.089-07:00A happens-before relationship is a guarantee that ...A happens-before relationship is a guarantee that memory written to by statement A is visible to statement B, that is, that statement A completes its write before statement B starts its read.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-694855878384792308.post-81874524936119762332018-02-10T07:57:31.968-08:002018-02-10T07:57:31.968-08:00Thanks for a good writeup!! A small note in point ...Thanks for a good writeup!! A small note in point 1 under when to use volatile,<br />I think it should be :<br />Any variable which is shared between multiple threads should be made "VOLATILE"Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-694855878384792308.post-78949460712355621642013-12-18T01:59:38.982-08:002013-12-18T01:59:38.982-08:00What is meaning of happens-before guarantee provid...What is meaning of happens-before guarantee provided by volatile variable in Java? How they achieve synchronization and how strong that is?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-694855878384792308.post-48390853213877008032013-08-25T21:12:20.675-07:002013-08-25T21:12:20.675-07:00Hello there, Can you please write about difference...Hello there, Can you please write about difference between volatile variable in Java 1.4 and Java 5? I heard there are some changes made on How volatile variable works to fix the double checked locking problem, love to see an english explanation.Anonymousnoreply@blogger.com