What does the volatile keyword do? In C++ what problem does it solve? In my case, I have never knowingly needed it. 19 Answers 19
  • May 21, 2022
  • 0 Comments
Is it correct to say that static means one copy of the value for all objects and volatile means one copy of the value for all threads? Anyway a...
  • May 18, 2022
  • 0 Comments
I am wondering at the difference between declaring a variable as volatile and always accessing the variable in a synchronized(this) block in Java? According to this article http://www.javamex.com/tutorials/synchronization_volatile.shtml there...
  • May 18, 2022
  • 0 Comments
This question already has answers here: Closed 11 years ago. Possible Duplicate: Why does volatile exist? I have never used it but I wonder why people use it? What...
  • May 5, 2022
  • 0 Comments
Why is volatile needed in C? What is it used for? What will it do? 18 s 18 volatile tells the compiler not to optimize anything that has to...
  • May 3, 2022
  • 0 Comments
At work today, I came across the volatile keyword in Java. Not being very familiar with it, I found this explanation. Given the detail in which that article explains...
  • April 24, 2022
  • 0 Comments
Let’s say that a class has a public int counter field that is accessed by multiple threads. This int is only incremented or decremented. To increment this field, which...
  • April 23, 2022
  • 0 Comments