How Volatile in Java works Example of volatile keywor

Tutorials Shared by the Internet Community

Advertisements


Synopsis

Volatile keyword in Java is used as an indicator to Thread that do not cache value of this variable and always read it from main memory.

Statistics

  • Total Hits - 14755

  • Total Votes - 96 votes

  • Vote Up - 41 votes

  • Vote Down - 55 votes

  • Domain - javarevisited.blogspot.com

  • Category - JAVA/Core JAVA

  • Submitted By - Javin Paul

  • Submitted on - 2011-06-27 15:14:29

Description

To Understand example of volatile keyword in java let’s go back to Singleton Pattern in Java
and see double checked locking in Singleton with Volatile and without volatile keyword in java. ...


Site  |   Broken  |   Tweet  |   Facebook  |     |   Save  |   Liked  |   Down

Advertisements