About 22,900 results
Open links in new tab
  1. java - What is the volatile keyword useful for? - Stack Overflow

    I came across the volatile keyword in Java. Not being very familiar with it, I found this explanation. Volatile variables are a simpler -- but weaker -- form of synchronization than locking, which...

  2. What does "volatile" mean in Java? - Stack Overflow

    The Java volatile keyword is used to mark a Java variable as "being stored in main memory". More precisely that means, that every read of a volatile variable will be read from the …

  3. Simplest and understandable example of volatile keyword in Java

    Jul 19, 2013 · I'm reading about volatile keyword in Java and completely understand the theory part of it. But, what I'm searching for is, a good case example, which shows what would …

  4. java - What are Transient and Volatile Modifiers? - Stack Overflow

    Aug 23, 2010 · The volatile modifier tells the JVM that writes to the field should always be synchronously flushed to memory, and that reads of the field should always read from memory …

  5. When exactly do you use the volatile keyword in Java?

    possible duplicate of For what is used "volatile" ?, Do you ever use the volatile keyword in Java?, using volatile keyword and many more.

  6. Difference between volatile and synchronized in Java

    Aug 19, 2010 · The important semantic shared by locks a volatile variables is that they both provide Happens-Before edges (Java 1.5 and later). Entering a synchronized block, taking out …

  7. Is a volatile int in Java thread-safe? - Stack Overflow

    Oct 18, 2011 · 6 Access to volatile int in Java will be thread-safe. When I say access I mean the unit operation over it, like volatile_var = 10 or int temp = volatile_var (basically write/read with …

  8. Volatile keyword in Java - Clarification - Stack Overflow

    Jun 12, 2014 · Before Java 1.5 was released the volatile keyword declared that the field will get the most recent value of the object by hitting main memory each time for reads and flushing for …

  9. multithreading - Volatile vs Static in Java - Stack Overflow

    Mar 11, 2010 · volatile: This keyword is applicable to both class and instance variables. Using volatile variables reduces the risk of memory consistency errors, because any write to a …

  10. java - Volatile Vs Atomic - Stack Overflow

    Java volatile keyword doesn't mean atomic, its common misconception that after declaring volatile, ++ operation will be atomic, to make the operation atomic you still need to ensure …