query: When exactly do you use the volatile keyword in Java?
positive_passages.docid: 21785
positive_passages.text: What is the volatile keyword useful for?
negative_passages.docid: 131997
negative_passages.text: When and how should I use a ThreadLocal variable?
negative_passages.docid: 40734
negative_passages.text: Are java primitive ints atomic by design or by accident?
negative_passages.docid: 158980
negative_passages.text: What are the differences between const and volatile pointer in C?
negative_passages.docid: 97624
negative_passages.text: In what order do static/instance initializer blocks in Java run?
negative_passages.docid: 599
negative_passages.text: Is Java "pass-by-reference" or "pass-by-value"?
negative_passages.docid: 93272
negative_passages.text: What is the "continue" keyword and how does it work in Java?
negative_passages.docid: 76841
negative_passages.text: When should one use final for method parameters and local variables?
negative_passages.docid: 135058
negative_passages.text: What triggers a full garbage collection in Java?
negative_passages.docid: 58713
negative_passages.text: When is it best to use the stack instead of the heap and vice versa?
negative_passages.docid: 149187
negative_passages.text: Is accessing a variable in C# an atomic operation?
negative_passages.docid: 97149
negative_passages.text: Why should I use the keyword "final" on a method parameter in Java?
negative_passages.docid: 76851
negative_passages.text: In Java, how do you determine if a thread is running?
negative_passages.docid: 150815
negative_passages.text: When to use volatile with multi threading?
negative_passages.docid: 104089
negative_passages.text: Are there any differences between Java's "synchronized" and C#'s "lock"?
negative_passages.docid: 148371
negative_passages.text: Why use a ReentrantLock if one can use synchronized(this)?
negative_passages.docid: 51725
negative_passages.text: When is it preferable to use volatile boolean in Java rather than AtomicBoolean?